Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2011

    Unanswered: Calculating Time Difference between two different dates

    Hi all,

    I have data in which i need to calculate employees working hours for a day...
    name time in_out
    manisha 2011-01-01 9:30:00.000am 1
    manisha 2011-01-01 10:30:00.000 0
    manisha 2011-01-01 10:45:00.000 1
    manisha 2011-01-02 1:00:00.000am 0

    how can i calculate time in that two dates as 1 is for entry an 0 is for exit..
    please give me solution ASAP.... its urgent

  2. #2
    Join Date
    Nov 2011
    This Query may help you to get total time for each employee on particular date.

    Select CONVERT(varchar(8), [time], 112) as [Date],name,DATEDIFF(hh,min(time),max(time)) from difftest group by name ,CONVERT(varchar(8), [time], 112)

  3. #3
    Join Date
    Nov 2011


    Hi its working for only for same date..but according to my question i need time between 2 different dates..means tht person come on one day and went on next day.....

    How i can calculate tht time??

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts