What does the $ mean in this calculation?

  • I have a stored procedure that has a calculation the looks like this:

    [Total Minutes] = SUM(CONVERT(INT, CEILING(DATEDIFF(SECOND, CallStartUTC, CallEndUTC) / $60))),

    I have never seen a $ used like this and was wondering what it does. If I take the $ out, every result is 0, but if I leave it in everything looks normal.

    I searched all over but most search engines don't work well when looking for $ usage.

  • When I just select $60:

    It looks as though it casts it as smallmoney.

  • $20 is a literal of the data type money/smallmoney, because they're the only data types that can have a currency symbol in front, just like 10.0 would be a literal of the type numeric/decimal/float (can't remember exactly which one)

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply