Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Correct Syntax for Between Dates Criteria in Query 2

Status
Not open for further replies.

gallas

Technical User
Feb 5, 2002
55
GB
I'm trying to collect two date values from text boxes on a form and then set these as the start and end dates for query criteria. I can't seem to get the syntax right. I'm building it in the Access query design grid. Here is an example.

Between "#" & [forms]![frmQuoteRptChoice]![StartDate] & "#" And "#" & [forms]![frmQuoteRptChoice]![EndDate] & "#"

Any Ideas? :)

"If a job's worth doing, it's worth doing twice!"
 
if the controls are already set to date format then you don't need any of the & or #

only add them in if the control is set to text

--------------------
Procrastinate Now!
 
Hi!

If the fields referenced by the text boxes are formatted as date/time then you need to get rid of the # signs.

hth


Jeff Bridgham
bridgham@purdue.edu
 
Thanks guys, that works fine. Odd because that's what I thought I tested originally - must have made a small un-noticed typo. Stars all round!

Thanks again. [thumbsup]

"If a job's worth doing, it's worth doing twice!"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top