Money and Decimal Datatypes

  • Missed it. Good reminder to specify precision.

  • Nice question thanks! I wish SQL Server had an option to require that all variable declarations include the size parameters.

  • Thanks for the question! We should make a rule that all Monday QOTD have to be "back to basics" type of questions, mirroring the The New York Times crossword puzzle which is always easy on Mondays.

  • A mental point to myself for thinking about the answer and then executing it 😀 It's almost like not cheating!

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • Good question.

  • I remember my first experience with datatypes, like;

    DECLARE @1value int

    DECLARE @2value int

    SET @1value = 3

    SET @2value = 2

    SELECT @1value / @2value

  • Got it wrong :doze:

    I tought the default scale on decimal would be 2

    Should have take time to verify...

    Good question, Thanks!

  • Nice question.

    -----------------
    Gobikannan

  • pdooley-1104895 (4/18/2011)


    I wish you would have asked about a SET @dvalue = 10.12

    Even though I got the answer correct the 10.10 clouds weather the (10) or the (.10) is the number being stored.

    good question! Peace

    Since the data type is DECIMAL with no scale (= how many positions to the right of the decimal indicator), it's the integer part (10) that get's stored. Or in other words--truncation will never occur on the integer part of a decimal...

    Hope this helps.

    Regards,

    Michael

  • i got 94.3400

Viewing 10 posts - 16 through 24 (of 24 total)

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