By using Cron tab, a class method is called which runs a query to find all records whose stay date is within 72 of the moment in time the scheduled class method is called.
I honestly can’t simplify what I’ve written, other than re-stating.
I’m not looking for records between one stay date and another; I’m looking for all records whose stay date is within 72 hours of the moment in time the scheduled class method is called, thus the use of the now() function.
You want to SELECT the records of whose stay dates are 72 hours or less than (NOW() + 72), correct?
For example,
stay_date record 1 is 2011-07-16 17:10:00
stay_date record 2 is 2011-07-16 16:25:00
stay_date record 3 is 2011-07-15 11:00:00
stay_date record 4 is 2011-07-14 12:30:00
stay_date record 5 is 2011-07-13 10:00:00
So, say you have your cron/query set to run at 16:30 everyday. On this particular day, 2011-07-13 16:30:00 it runs. The following records will be retrieved.
stay_date record 2 is 2011-07-16 16:25:00
stay_date record 3 is 2011-07-15 11:00:00
stay_date record 4 is 2011-07-14 12:30:00
stay_date record 5 is 2011-07-13 10:00:00
Is that what you want? If so, you will need to include more with your condition so that it does not return results further back than the NOW() / query run time (like record 5 in the example).