Search code examples
mysqlemaileasyphp.aspxauth

In MySQL If 'CURDATE' is today, what is tomorrow?


I want bookings for tomorrow to receive an auto-email as a reminder, but I'm unsure how to only send to tomorrows clients.


Set rs = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM enquiries where emailaddress > '' and bookingdate = CURDATE() and statusbar <> 'calledtoconfirm' and lang_code = 'EN' "
'strSQL = "SELECT * FROM enquiries where emailaddress = '' "
rs.Open strSQL, adoCon

I'm working on a live site, so to test it would be to send hundreds of emails.


Solution

  • To get the bookings for tomorrow

    Just change the following clause in your current query using DATE_ADD function

       AND bookingdate = DATE_ADD(CURDATE(), INTERVAL 1 DAY)