Missing Expression

  • Thread starter Thread starter Edm
  • Start date Start date
E

Edm

I get this message when trying to open a form to search
between 2 dates.

Missing ),], or Item in query expression '(((STOCK_WHSE27.
[Date Received]) >= #date# And (STOCK_WHSE27.[Date
Received])) <= #date#

Ive tried multiple variations of this query, and can
narrow it down to "Object Required" error, but that doesnt
really help functionality. =/

Im a relative novice. Could someone help break this down
for me?
 
I get this message when trying to open a form to search
between 2 dates.

Missing ),], or Item in query expression '(((STOCK_WHSE27.
[Date Received]) >= #date# And (STOCK_WHSE27.[Date
Received])) <= #date#

Ive tried multiple variations of this query, and can
narrow it down to "Object Required" error, but that doesnt
really help functionality. =/

Im a relative novice. Could someone help break this down
for me?

What are you actually referring to by #date#?
Is that just an abbreviation in this message and you actually have
something like #5/25/2003# written in the SQL, or do you actually have
#date# written?

If the actual SQL is using #Date# then change that to

Where [STOCK_WHSE27].[Date Received] >= [Start Date] And
[STOCK_WHSE27].[Date Received] <= [End Date]

You will be prompted to enter the starting and ending dates.

You could also write:
Where [STOCK_WHSE27].[Date Received] Between [Start Date] And [End
Date]
 
#date# is actually a user inputted value in the SQL which
would show up in something akin to 6/1/2004, in US
standard MM/DD/YYYY format.

Ive used a query to accomplish this search on a single
table in the past, but am now trying to open multiple
tables with the same input sequence in an attempt to
eliminate redundant entries by the user.
-----Original Message-----
I get this message when trying to open a form to search
between 2 dates.

Missing ),], or Item in query expression '(((STOCK_WHSE27.
[Date Received]) >= #date# And (STOCK_WHSE27.[Date
Received])) <= #date#

Ive tried multiple variations of this query, and can
narrow it down to "Object Required" error, but that doesnt
really help functionality. =/

Im a relative novice. Could someone help break this down
for me?

What are you actually referring to by #date#?
Is that just an abbreviation in this message and you actually have
something like #5/25/2003# written in the SQL, or do you actually have
#date# written?

If the actual SQL is using #Date# then change that to

Where [STOCK_WHSE27].[Date Received] >= [Start Date] And
[STOCK_WHSE27].[Date Received] <= [End Date]

You will be prompted to enter the starting and ending dates.

You could also write:
Where [STOCK_WHSE27].[Date Received] Between [Start Date] And [End
Date]
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.
 
#date# is actually a user inputted value in the SQL which
would show up in something akin to 6/1/2004, in US
standard MM/DD/YYYY format.

Ive used a query to accomplish this search on a single
table in the past, but am now trying to open multiple
tables with the same input sequence in an attempt to
eliminate redundant entries by the user.
-----Original Message-----
I get this message when trying to open a form to search
between 2 dates.

Missing ),], or Item in query expression '(((STOCK_WHSE27.
[Date Received]) >= #date# And (STOCK_WHSE27.[Date
Received])) <= #date#

Ive tried multiple variations of this query, and can
narrow it down to "Object Required" error, but that doesnt
really help functionality. =/

Im a relative novice. Could someone help break this down
for me?

What are you actually referring to by #date#?
Is that just an abbreviation in this message and you actually have
something like #5/25/2003# written in the SQL, or do you actually have
#date# written?

If the actual SQL is using #Date# then change that to

Where [STOCK_WHSE27].[Date Received] >= [Start Date] And
[STOCK_WHSE27].[Date Received] <= [End Date]

You will be prompted to enter the starting and ending dates.

You could also write:
Where [STOCK_WHSE27].[Date Received] Between [Start Date] And [End
Date]
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.

You must use the brackets, as I posted above, and you should not use
Date (by itself), as Date is a reserved word in Access/VBA.
Use [Enter Date] or [Start Date], etc.

To use the same parameter values on multiple queries, use an unbound
form with unbound controls to enter the values.
Then change the query criteria to:
Where [STOCK_WHSE27].[Date Received] Between
forms!FormName!StartControlName And forms!FormName!EndControlName

You can use a command button on the form to then either hide the form
until you no longer need it, or to open the queries.

As long as the form is open, you will not be prompted for the dates.
 
Back
Top