Forum Moderators: open
I need to keep track of whether a certain account is within a 60 day trial period, and I include this line in the query:
WHERE auth='N' and 60 - (TO_DAYS(NOW()) - TO_DAYS(regdate)) > 0
which checkes the registration date, and subtracts the to_days until NOW, then from 60 and compares that to 0. This brings me back records that are within 60 days of the registration date.
Dates are a nasty business.
Thanks for your reply. I had to laugh when you said "Dates are a nasty business" because it's true. This is the second time in the past few weeks that I've had trouble figuring out something with dates!
I modified the query you posted to suit my needs but it still doesn't seem to do what I want. If you're familiar with the financial world, what I am trying to do would basically represent "NET 30" billing. Where every thirty days between the duration_start and duration_finish relevant records would appear waiting to be billed if now() falls between the two dates and every 30 days between the two dates.
Thanks for your help!
Steve