Rubicon2009
asked on
SQL Server Management Studio is automatically rounding my calculation
Hi !
SQL Server Management Studio is automatically rounding my calculation done in TSQL in the result pane. How can I avoid this.
Thank You !
SQL Server Management Studio is automatically rounding my calculation done in TSQL in the result pane. How can I avoid this.
Thank You !
ASKER
SELECT (A.ActualEnd - A.ActualStart - Isnull(A.Lunch, 0)) / 60 AS 'FinalDuration'
with real values, the result will be 7 instead of 7,25
SELECT (780 - 300 - 45) / 60
FYI, values are minutes from midnight
printscreen.png
with real values, the result will be 7 instead of 7,25
SELECT (780 - 300 - 45) / 60
FYI, values are minutes from midnight
printscreen.png
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Using CAST like suggested is still giving me the wrong results, I now optain 7.00 instead of 7.25
ASKER
(780 - 300 - 45) / 60.0
Is resulting 7.25000
:)
Is resulting 7.25000
:)
ASKER
Thank You
Select cast(field as decimal(18,2)) from table
If you give us your query and sample data we can give more specific help.