Value Truncates When Using Float Datatype

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Aads
    New Member
    • Mar 2008
    • 48

    Value Truncates When Using Float Datatype

    Hi all,

    Below is my query which truncates the value of the float variable. I have no clue why it truncates. Can anyone help me out?


    Declare @myValue Float
    set @myValue = 0.0045645667657 7567
    Print @myValue


    Thanks,
    Aads
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    Can you use decimal instead of float?

    Code:
    Declare @myValue decimal(20,20)
    set @myValue = 0.00456456676577567
    Print @myValue
    -- CK

    Comment

    • Aads
      New Member
      • Mar 2008
      • 48

      #3
      Yeah I can use decimal instead of float. Thanks a lot! It works!


      Regards,
      Aads

      Comment

      Working...