A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Problem with a DoCmd.RunSQL construct



 
 
Thread Tools Display Modes
  #1  
Old May 7th, 2004, 10:17 PM
Brian
external usenet poster
 
Posts: n/a
Default 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  
Old May 7th, 2004, 10:40 PM
Douglas J. Steele
external usenet poster
 
Posts: n/a
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:21 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.