I need to calculate the diff and have my answer show minutes and seconds. Here is sample
Declare @clockin datetime, @clockout datetime, @total decimal(18,4)
Set @clockin = '2015-01-03 08:15:19.000'
Set @clockout = '2015-01-03 12:02:42.000'
Set @total = DateDiff(minute, @clockin, @clockout)
But this returns a whole number I need it to show seconds as well.
I hope this approach can help you, the solution in this way is simple, we just get the quantity of seconds in between, then we calculate the minutes by a simple division and seconds with the module operator.
If you want to extend your approach, just change it a bit calculating the differece in seconds but minutes and doing the same like above to separate minutes and seconds, it would look like this:
Result:
Minutes: 227, Seconds: 23