Link to home
Start Free TrialLog in
Avatar of Cartillo
CartilloFlag for Malaysia

asked on

Sum total duration

Hi Experts,

I would like to request Experts help. Is that any possibilities to build MSSQL formula for total duration at column “Total_Duration” based on data at column TimeIN(time) and TimeOUT(time). Intent to add this formula at “Computed Column Specification” at ( formula) row. Hope Experts will help to create this formula.


Avatar of mayank_joshi
mayank_joshi
Flag of India image

you can use
TimeIN-TimeOUT

Open in new window

sorry

TimeOUT-TimeIN

Open in new window

 (datediff(MINUTE,[TimeOUT],[TimeIN])) 

 (datediff(HOUR,[TimeOUT],[TimeIN])) 

 (datediff(SECOND,[TimeOUT],[TimeIN]))

Open in new window


you can use either of the above 3 methods to get time difference in minutes,HOURS or SECONDS respectively.
ASKER CERTIFIED SOLUTION
Avatar of mayank_joshi
mayank_joshi
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Cartillo

ASKER

Hi,

Thanks for the help