If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Problem with a DoCmd.RunSQL construct
If I create the following query and run it I get no
records: SELECT AVAILABILITY.BookingDate FROM AVAILABILITY WHERE AVAILABILITY.BookingDate=#07/09/2004# And AVAILABILITY.Period=1 And AVAILABILITY.Room="H4"; Looks like it is a problem with the date. I have a form setup whereby a user enter a date and runs a SELECT query (DoCmd.OpenQuery "QueryAv") with the same WHERE as the one that fails but that returns records which suggests that it is a problem using the DoCmd.RunSQL strSQL construct. Any ideas? |
#2
|
|||
|
|||
Problem with a DoCmd.RunSQL construct
You can't use DoCmd.RunSQL with a SELECT statement: it's only for action
queries (INSERT INTO, UPDATE or DELETE) -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (No private e-mails, please) "Brian" wrote in message ... If I create the following query and run it I get no records: SELECT AVAILABILITY.BookingDate FROM AVAILABILITY WHERE AVAILABILITY.BookingDate=#07/09/2004# And AVAILABILITY.Period=1 And AVAILABILITY.Room="H4"; Looks like it is a problem with the date. I have a form setup whereby a user enter a date and runs a SELECT query (DoCmd.OpenQuery "QueryAv") with the same WHERE as the one that fails but that returns records which suggests that it is a problem using the DoCmd.RunSQL strSQL construct. Any ideas? |
Thread Tools | |
Display Modes | |
|
|