none
How to round value that I'm querying from a table RRS feed

All replies

  • What's the data type of F1 column? What's the error message? Any possibilities to have string data that we can't round? 

    You may test below to see if it works 

    SELECT efc.F1
    	,Round(try_cast(efc.F1 AS FLOAT), 0)
    FROM cinderella AS efc


    If the response helped, do "Mark as answer" and upvote it
    - Vaibhav

    Tuesday, January 14, 2020 6:58 PM
  • Hi chiquez,

    Please share us the error message that you got. Could you please share some samples about your table? The data type of F1 is the exact numeric or approximate numeric data type category, except for the bit data type. 

    Please specify a table name when referring to F1, please try below;
    SELECT efc.F1, Round(efc.F1,0) FROM cinderella AS efc
    If your data type is out of round, you can try to use CAST and CONVERT function to convert one data type to another.

    I also found some similar threads, you can refer to the examples. Hope they could help you.
    How to use rounded value for join in SQL
    SQL values rounding

    Best regards,
    Cathy 

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to  MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Wednesday, January 15, 2020 6:14 AM
  • Hi chiquez,

    Any update? If the reply could help you, please mark the useful reply as answer. This can be beneficial to other community members reading the thread.
    In addition, if you have another questions, please feel free to ask.
    Thanks for your contribution.

     
    Best regards,
    Cathy 

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to  MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Thursday, January 16, 2020 9:07 AM