Suppose I have a datetime field whose value is 2000-01-01 08:30:00
and a duration field whose value is say 00:15( meaning 15 minutes)
If I subtract these two, I should get 2000-01-01 08:15:00
I am trying like SELECT DATEDIFF(minute, '00:15','2000-01-01 08:30:00');
But the output is 52595055. How can i get the desired result.
N.B.~ If I do like SELECT dateadd(minute, -15,'2000-01-01 08:30:00');
, I will get the desired result but that involves parsing the minute field.
Also if I want to subtract 1:15( means 1 hour 15 minutes), the output will be 2000-01-01 07:15:00
Edit:
As per the answers I got here every one is suggesting to convert everything into minutes and then to subtract like if it is 1:30 means i need to subtract 90 minutes. That's fine. Any other way without converting to minutes?
Thanks