pspkshah (5/29/2015)
Hello friends,how can I get time difference of the following record please help,
STARTTIME ENDTIME
3:30 PM 4:30PM
7:30 PM 8:30PM
I have tried it by below query,
SELECT CONVERT(TIME,STARTTIME,108) - CONVERT(TIME,ENDTIME,108) FROM BATCH_MASTER
but it gives following error message
Operand data type time is invalid for subtract operator.
''
Are there date columns that go with each of these times? I ask because if someone has a start time of, say, 11:00 PM and an end time of 06:00 AM the next day, you're going to run into a wee bit of a problem. There's a work around but having date associated with each time would make this a whole lot easier.
--Jeff Moden
Change is inevitable... Change for the better is not.