Results 1 to 3 of 3

Thread: Report

  1. #1
    Join Date
    Jul 2003
    Posts
    142

    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

  2. #2
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    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

  3. #3
    Join Date
    Jul 2003
    Posts
    142
    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
  •