Hi guys ,
I am creating a timekeeping application to keep track of users.
In my database I have a table which stores the time a user starts their break and finishes their break. I want to return the total time that the user is on break in minutes to another row called "totalbreak"
break_id - int
rec_id - int
userid - int
breakStart - time
breakEnd - time
breaktotal - int
reason - text
I have tried to calculate the difference in minutes between the two dates using ;
SELECT DATEDIFF(MI, breakstart, breakend) from RP_RecordBreaks where break_id=2
However this returns a value of -1071.
If somebody could point me in the right direction, it would be greatly appreciated.
thanks very much