G
Guest
I want to create a from which takes the user input date from a text box,
assigns it to a variable (using VBA) and then uses that variable to from part
of my WHERE clause in an SQL query (not QBE Grid query) and then execute that
SQL query.
I have done similar things with text before but not dates.
The date format on the form I want to use is DD/MM/YYYY.
I believe that SQL queries in MS Access are formatted in MM/DD/YYYY.
I was wondering if you know if I will experience any trouble with the date
format, and if you have any tips for this (or the process as a whole).
An example query at the moment using just hard dates, is as follows.
lic_grant (is licence granted date)
lic_sur (is licence surrendered date)
SELECT tblCustomer.company, tblCustomer.lic_sur, tblCustomer.lic_grant,
FROM tblCustomer
WHERE (((tblCustomer.lic_sur) Is Null) AND
((tblCustomer.lic_grant)<=#6/30/2005#)) OR
(((tblCustomer.lic_sur)>=#7/1/2004#) AND
((tblCustomer.lic_grant)<=#6/30/2005#))
ORDER BY tblCustomer.lic_grant;
Your assistance is appreciated.
assigns it to a variable (using VBA) and then uses that variable to from part
of my WHERE clause in an SQL query (not QBE Grid query) and then execute that
SQL query.
I have done similar things with text before but not dates.
The date format on the form I want to use is DD/MM/YYYY.
I believe that SQL queries in MS Access are formatted in MM/DD/YYYY.
I was wondering if you know if I will experience any trouble with the date
format, and if you have any tips for this (or the process as a whole).
An example query at the moment using just hard dates, is as follows.
lic_grant (is licence granted date)
lic_sur (is licence surrendered date)
SELECT tblCustomer.company, tblCustomer.lic_sur, tblCustomer.lic_grant,
FROM tblCustomer
WHERE (((tblCustomer.lic_sur) Is Null) AND
((tblCustomer.lic_grant)<=#6/30/2005#)) OR
(((tblCustomer.lic_sur)>=#7/1/2004#) AND
((tblCustomer.lic_grant)<=#6/30/2005#))
ORDER BY tblCustomer.lic_grant;
Your assistance is appreciated.