September 6, 2001 at 3:09 am
Does anyone know how add or sub time data types.
I have to count how long an employee has been at work that day. He/she can leave or be back at work several times per day.
Thanks
Mihael
September 6, 2001 at 5:20 am
Take a look at DateDiff and DateAdd in TSQL help.
Andy
September 6, 2001 at 1:14 pm
dateadd, datediff could help you for add / sub datetime fields and also datepart could be useful for you for date manipulations
Paras Shah
Evision Technologies
Mumbai, India
Paras Shah
Evision Technologies
Mumbai, India
December 8, 2002 at 4:58 pm
quote:
Does anyone know how add or sub time data types.I have to count how long an employee has been at work that day. He/she can leave or be back at work several times per day.
Thanks
Mihael
try this
select TimeInOffice=datediff(s, TimeIn, TimeOut) to get the values in seconds. If you create a denormalized field in your table, you can store this value when you set TimeOut. Then you can sum the TimeinOffice columns to get the total time for any period.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply