dstamford
5-29-07, 11:50 AM
Can anyone tell why the follow sql script does work properly:
SELECT consignees.`schdel_time`,`deltime`, subtime(`deltime`,consignees.`schdel_time`) as timediff FROM `invoices` left join consignees on (`consignee` = consignees.`id`) WHERE `deldate`="2007-03-28" and (subtime(`deltime`,consignees.`schdel_time`)>="00:15:00" or subtime(`deltime`,consignees.`schdel_time`)<="-00:15:00")
I am trying to get all delivery times +/- 00:15:00. The positive time >= 15 minutes works fine but the negative time only gives me delivery times from -00:01:00 through -00:15:00 instead of -00:15:00 and greater.
I would appreciate any assistance.
Doug
SELECT consignees.`schdel_time`,`deltime`, subtime(`deltime`,consignees.`schdel_time`) as timediff FROM `invoices` left join consignees on (`consignee` = consignees.`id`) WHERE `deldate`="2007-03-28" and (subtime(`deltime`,consignees.`schdel_time`)>="00:15:00" or subtime(`deltime`,consignees.`schdel_time`)<="-00:15:00")
I am trying to get all delivery times +/- 00:15:00. The positive time >= 15 minutes works fine but the negative time only gives me delivery times from -00:01:00 through -00:15:00 instead of -00:15:00 and greater.
I would appreciate any assistance.
Doug