Tuesday, 15 March 2011

sql - MySQL time between comparison past end of day -



sql - MySQL time between comparison past end of day -

i have query not working me in instances , think it's because time wraps past end of day in cases such end time less start time. here query.

select reminder_cfg.id, default_time, day_prior, timezone reminder_cfg, uc_users reminder_cfg.id = 5 , reminder_cfg.id = uc_users.id , default_time between time(now() + interval 5 hour) , time(now() + interval 10 hour)

this has been kicking couple of days now.

this part of perl script i'm sure there improve way do, i'm stumped.

using date_add add together 2 dates.

select reminder_cfg.id, default_time, day_prior, timezone reminder_cfg, uc_users reminder_cfg.id = 5 , reminder_cfg.id = uc_users.id , default_time between time(date_add(now(), interval 5 hour)) , time(date_add(now() + interval 10 hour))

mysql sql perl

No comments:

Post a Comment