MySQL Forums
Forum List  »  Newbie

Re: SQL query with Time
Posted by: Peter Brawley
Date: February 18, 2017 03:25PM

OK, as you're learning, SQL is a very awkward tool for computing times, eg
'00:00:00' is later than '23:59:59', so you have to handle multiple contingencies ...

...between starttime and 
   case 
     when endtime>=starttime then endtime
     when endtime<'12:00:00' then addtime(endtime,'12:00:00')
     when endtime='12:00:00' then '24:00:00'
     else subtime(endtime,'12:00:00')
   end...

Options: ReplyQuote


Subject
Written By
Posted
February 18, 2017 08:29AM
February 18, 2017 09:55AM
February 18, 2017 11:20AM
February 18, 2017 12:33PM
February 18, 2017 01:20PM
Re: SQL query with Time
February 18, 2017 03:25PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.