Query Question

  • Thread starter Thread starter DavidW
  • Start date Start date
D

DavidW

How do you phrase the expession in a query to retrieve the last group of
entries by date.
I am wanting to look in a table and get the last set of records entered by
date. If there is a month missing this would throw it of
Between DateSerial(Year(Date()),Month(Date())-1,Day(Date())) And
DateSerial(Year(Date()),Month(Date())-2,Day(Date()))
I need it to look at the date and find the last entered date and retrieve
all records with that date.
Thanks
David
 
On my website (see sig below) is a small sample database called
"MaxQueryProblem.mdb" which might give you a start.
 
Not having yet mastered SQL, I create most of my queries
in the Query Builder, switch to the SQL view, then copy
and paste into the VBA window. That's cheating, but I do
not have the time to learn SQL well enough to do things
the hard way.

Hope that helps!

Kevin
 
You should be able to do this by using the DMax()
function as the criteria for the date field.

This would look something like this:

DMax("[DateFieldName]","TableName")

If you wanted to limit the domain that the function looks
at, you could add a third optional argument specifying a
WHERE statement (without the word WHERE), but it doesn't
sound like you need that.

Hope this helps.
 
Back
Top