-
Report
Help Please.
How do you compute time diiference between two dates or based a query on a specific time in hours and minutes.
Any help would be appreciated.
Kind Regards
-
declare @startdate datetime
declare @enddate datetime
declare @Hr int
declare @Min int
declare @Sec int
set @startdate ='Aug 8 2003 10:50:32:000'
set @enddate ='Aug 8 2003 12:53:32:000'
set @hr=datediff(hh,@startdate,@enddate)
set @min = datediff(n,@startdate,@enddate)
set @sec = datediff(ss,@startdate,@enddate)
set @Hr = (@sec/60)/60
print @hr
set @min = (@sec/60)-(@hr*60)
print @min
-
Thank you.
I have modified solution using cursor.
Regards
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
|
|