Division in SQL Server
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Division in SQL Server

Hybrid View

  1. #1
    Join Date
    Jan 2013

    Division in SQL Server

    All sources I found today say that if I need to divide one value let's say Profit on another one, let's say Selling price (markup), I need to use / operator, so:
    Select Profit/SellingPrice AS Markup from...
    By some reason I always get ZERO when Profit is smaller than SellingPrice.
    Both columns in the table are MONEY type, not integers or something like that
    Why is that?

    Thank you.

  2. #2
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Wallisellen (ZH), Switzerland

    Re: Division in SQL Server

    If you searched with Google for Division in SQL Server money you'd see that you were not the first who had got this problem...
    Victor Nijegorodov

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

This is a Codeguru.com survey!

HTML5 Development Center