Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with Time Difference Please

Status
Not open for further replies.

linuxjr

Programmer
Jun 2, 2001
135
US
I'm using Sybase Adaptive Server Anywhere. I want to be able to find the time difference in decimal format. The example would be:

hours_start hours_end
-----------------------------
4:00 AM 5:15 AM

I have tried this sql statement:

select datediff(minutes, hours_end, hours_start)

I get 75 minutes which is correct but I want to get 1.25 (75/60) so I try this:

select datediff(minutes, hours_end, hours_start)/60

but I get a one. Any help or tips be greatly appreciated. Have a nice day.

I know the
 
linuxjr, try this.

Select datediff(minutes, hours_end, hours_start)/60.0

By the way, which database are you using. You shouuld post your questions for specific databases in the appropriate forums. Terry L. Broadbent - DBA
Computing Links:
faq183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top