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

Date Criteria in a Query

Status
Not open for further replies.

pallaske

MIS
Oct 25, 2001
1
US
I have come across a problem that I have been unable to fix. In Access 97 when I want to sort a query by date I am getting the error message:
"This expression is typed incorrectly, or it is too complex to be evaluated. For example, a numeric expression may contain too ;many complicated elements. Try simplifying the expression by assigning parts of the expression to variables."
The way that the date criteria is typed is "Date[], =Date()" and many other variations of them. The query runs fine without it, but I need to run the query with the date criteria in it.
Any suggestions????

Thank you.
 
I have many records that are the same exept with different dates.
How can a run a query to find the latest date.
For example I am tracking preventative maintenance on a machine.
I have 10 entries for this particular machine, but I only want to see the latest entry (date)

Thanks
 
What is it that you are trying to pull from the date criteria Pallaske? Are you trying to ask it to show you records where the date equals the current date? If so, I believe the syntax should be

=Date()

You would put this in the criteria field for the date field. If you are trying ask a different question, please clarify. Dawn
 
To answer your question Racman, you would create a query with only 2 fields, the date feild and the machine field. You would sort the date feild "desending" and then click on the totals button to add the total row to the design grid. You would set the machine field to "Group by" and the date feild to "first" this will give you the most recent date for each machine. Dawn
 
racman - If you are looking for the one record with the most recent date, look in Access help for the Max function....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top