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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query date range from unbound form

Status
Not open for further replies.

ArffMarine

Technical User
Jan 20, 2004
23
0
0
US
I have a table titled TestAnalysis
This table stores information on the number of students in a class who missed questions on two seperate exams. The exams are administered to the students on two seperate dates. Each quarter we analyze the number of missed questions to validate our tests.

What I would like is to have a form that runs an aggregate query that only returns the records between two dates enterd on an unbound form that runs the query.

I am having a problem with the criteria in that I don't know what to put for the criteria.

I tried

Between Forms!QuarterlyTestAnalysis!Start and Forms!QuarterlyTestAnalysis!End

With this criteria i get no results in my query.

I also tried
Between DateValue [Forms]![QuarterlyTestAnalysis]![Start] and DateValue [Forms]![QuarterlyTestAnalysis]![End]

again, With this criteria i get no results in my query.

I finally tried

Between #Forms!QuarterlyTestAnalysis!Start# and #Forms!QuarterlyTestAnalysis!End#

But it gets kicked back as an incorrect date function



The fields I need to query are DateMidBlocked and DateEndBlocked

The form i am using to run the query is titled QuarterlyTestAnalysis and the field the dates are entered are titled Start and End

Please advise.
 
An expression like
Between Forms!QuarterlyTestAnalysis!Start and Forms!QuarterlyTestAnalysis!End
should work. What is the full SQL view of your query? Is the form remaining open?

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
And what is the date format of the field in the database?

Leslie
 
Thank you for your replies.

dhookum in reply to your response:

The string you posted was right on the money. The problem was the text fields in my form were not named properly.

I did not post the full SQL because the problem was fixed.

The form will remain open until close by the user.

lespaul in reply to your respone:

the date format is medium date or DD-MMM-YY

I Would like to change this to Military format which is YYYMMDDD which would display 18 January 2004 as 20040118

Thank you for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top