-
Setting Precision in SQL Query
I have a calculated field in a SQL query that sometimes ends up in running decimal fields for more than 15 decimal places. I want to evenly truncate it to 6 decimal places for all records. Please let me know the command in SQL to do so.
Thanks
-
If it is SQL Server you can use CAST or CONVERT functions
select CONVERT(decimal(25,6),yourvariable)
from yourtable
or
select CAST(yourvariable as decimal(25,6))
from yourtable
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|