Convert FLOAT to NUMBER without DECIMAL PLACE

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • flickimp
    New Member
    • Dec 2006
    • 37

    Convert FLOAT to NUMBER without DECIMAL PLACE

    Hi

    Got various fields in T-SQL where a decimal point and a zero follows each value:

    ie:

    46.0
    54.0
    234.0

    etc

    The fields were orignally set up as float.

    Can I use a quick convert or cast to remove the ".0"
  • iburyak
    Recognized Expert Top Contributor
    • Nov 2006
    • 1016

    #2
    Just convert\cast to int or bigint.

    Comment

    • flickimp
      New Member
      • Dec 2006
      • 37

      #3
      Thanks

      Tried converting but getting this message:

      Server: Msg 8114, Level 16, State 5, Line 1
      Error converting data type varchar to bigint

      Comment

      • iburyak
        Recognized Expert Top Contributor
        • Nov 2006
        • 1016

        #4
        Try this

        [PHP]select convert(decimal , '5.0')[/PHP]

        Comment

        Working...