Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 2 of 2 total |
Calculaing difference in time |
Thu, Mar 4 2010 4:22 AM | Permanent Link |
Stenstrup | Hi
I have the following table: StartTime StopTime 10:00:00 10:32:20 10:55:12 11:13:55 11:21:04 11:25:41 I want to calculate the difference in time from the first StopTime to the next StartTime!!! Like this: StartTime StopTime IdleTime 10:00:00 10:32:20 00:00:00 10:55:12 11:13:55 00:22:52 11:21:04 11:25:41 00:07:09 Thanks |
Thu, Mar 4 2010 12:23 PM | Permanent Link |
John Hay | Stenstrup
> Hi > I have the following table: > > StartTime StopTime > 10:00:00 10:32:20 > 10:55:12 11:13:55 > 11:21:04 11:25:41 > > I want to calculate the difference in time from the first StopTime to the next StartTime!!! > > Like this: > > StartTime StopTime IdleTime > 10:00:00 10:32:20 00:00:00 > 10:55:12 11:13:55 00:22:52 > 11:21:04 11:25:41 00:07:09 Something like the following should do it select starttime,stoptime, right('0'+cast(hoursfrommsecs(stoptime-starttime) as char(2)),2)+':'+right('0'+cast(minsfrommsecs(stoptime-starttime) as char(2)),2)+':'+right('0'+cast(secsfrommsecs(stoptime-starttime) as char(2)),2) from table John |
This web page was last updated on Tuesday, April 30, 2024 at 03:55 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |