Link to home
Start Free TrialLog in
Avatar of fippif
fippif

asked on

SQL - How to decrease decimal places (or remove the extra zero's at the end)

I have a table1 that saves the duration for a trip. table1 contains the following columns:
hourStart
hourEnd
minuteStart
minuteEnd

To calculate the duration of the trip, I am using the following query:
select ((hourEnd-hourStart) + ((cast((minuteEnd-minuteStart) as decimal))/60)) as trip  from table1

This works, except the results have too many zero's at the end:
1.500000

I want to format this as followed:
1.50

Is there a way to decrease the decimal places (or remove the extra zero's at the end)?
ASKER CERTIFIED SOLUTION
Avatar of chapmandew
chapmandew
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial