Gary Williams
06-10-2005, 06:47 PM
Hi All,
I have written a vbs script that searches an access database and outputs the resulting recordset into an html table which I then email to myself so that each morning I have a list of enquirers sitting in my email in box, ready for processing.
The SQL query I use is this:
strSQL = "SELECT enquirynumber, email FROM enquiries WHERE ((enquiryentered>(#2005-06-09 18:00:00#)) AND (enquiryentered<(#2005-06-10 08:00:00#)));"
This works fine and returns a list of enquiriers who left details via my web form after 6pm on 9th June and before 8am on 10th June.
The problem is that the DateTime is hardcoded. If I only needed the dates, I could use the following to automatically increase the date each day:
(((enquiryentered>(Date()-1)) AND (enquiryentered<(Date()-0)))
but I need the time as well - 6pm yesterday and 8am today.
How do I get the Time into the sql query as well as the date?
Regards
Gary
I have written a vbs script that searches an access database and outputs the resulting recordset into an html table which I then email to myself so that each morning I have a list of enquirers sitting in my email in box, ready for processing.
The SQL query I use is this:
strSQL = "SELECT enquirynumber, email FROM enquiries WHERE ((enquiryentered>(#2005-06-09 18:00:00#)) AND (enquiryentered<(#2005-06-10 08:00:00#)));"
This works fine and returns a list of enquiriers who left details via my web form after 6pm on 9th June and before 8am on 10th June.
The problem is that the DateTime is hardcoded. If I only needed the dates, I could use the following to automatically increase the date each day:
(((enquiryentered>(Date()-1)) AND (enquiryentered<(Date()-0)))
but I need the time as well - 6pm yesterday and 8am today.
How do I get the Time into the sql query as well as the date?
Regards
Gary