Query by last record date

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

DavidW

I didnt see this on the list from yesterday, so I am reposting it.
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
 
Dear David

It should be possible to get the result you are after by
using the DMax() function as the criteria for the relevant
date field.

try something like

DMax("[YourDateField]","TableContainingDateField")

Hope this helps

Paul
 
Paula,
When I use the max function in the query, it stil does not give the last
date, it gives all of the dates.
The query has to tables linked by a relationshiop of 1. I have tried
changing those to 2 and 3 and it doesnt change the results.
I know you cant see my destop, but do you have any ideals?
Paul Falla said:
Dear David

It should be possible to get the result you are after by
using the DMax() function as the criteria for the relevant
date field.

try something like

DMax("[YourDateField]","TableContainingDateField")

Hope this helps

Paul
-----Original Message-----
I didnt see this on the list from yesterday, so I am reposting it.
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


.
 
Back
Top