Hi,
How would I go about checking mysql date/time formated field for all records with tomorrows date… ?
Thanks
Hi,
How would I go about checking mysql date/time formated field for all records with tomorrows date… ?
Thanks
you do mean DATETIME, not DATE, right?
WHERE column >= CURRENT_DATE + INTERVAL 1 DAY
AND column < CURRENT_DATE + INTERVAL 2 DAY
fyi, we call them columns and rows, not fields and records
Hey,
Yea definatly DATE/TIME… It apears to work… But I have a small issue as this will be run as a cron job, but ther server is on a different time zone… So the records wont match to the date of the server.
Thanks
so add or subtract the requisite number of hours…
Via the query or in the cron job?
you can do it in the query…
WHERE column >= CURRENT_DATE + INTERVAL 1 DAY - INTERVAL 3 HOUR
AND column < CURRENT_DATE + INTERVAL 2 DAY - INTERVAL 3 HOUR
Does the query only take the DATE part of the field into consideration? so it doesnt matter at what hour the query runs it will grab all records for the follwoing day no matter what the TIME part of the field is?
Thanks…
what happened when you tested it?
I thought it missed records from a certain hours… But looks like it takes the date only into consideration…