Need query to return last 10 days

sarab99

Registered User.
Local time
Tomorrow, 00:46
Joined
Mar 23, 2009
Messages
10
Hi Expert

I need query to return last 10 days from last date in the table.

I have use the following creteria >=DateAdd("d",-1,Date())-10

but this will return the last date from the current date. I need to return the last 10 days depends on last day in the table.

note the table called table1 and the date filed caled ddate

Thank you
 
Looks like you're familiar with functions. Lookup the DMax() function as well. Then use BETWEEN with your DateAdd() function. Something like this:

BETWEEN # DMAX() # AND DateAdd()
 
DMAX() dosnt work with query creteria

I got error message.

Could you please advise.

Thank you
 
Could you show what you wrote and the error message?
 
Actually the criteria to get the date range would be:

Between DateAdd("d", -10, Date()) And Date()
 
Actually the criteria to get the date range would be:

Between DateAdd("d", -10, Date()) And Date()

Never mind - I didn't read the first part close enough. DMax would be the way to go but you have to include the arguments:

Between DateAdd("d", -10, DMax("[FieldName]", "TableName")) And DMax("[FieldName]", "TableName")
 
Instead of uploading it to IMAGE SHACK, could you just upload the image here so those of us at work whose work blocks those public image sites can see what you're posting?
 
Never mind - I didn't read the first part close enough. DMax would be the way to go but you have to include the arguments:

Between DateAdd("d", -10, DMax("[FieldName]", "TableName")) And DMax("[FieldName]", "TableName")


Thank you Mr. SOS it is working now with your great creteria :)


Thanks to others who trying to help.

Regards,
 
Glad we could help you out. :)
 

Users who are viewing this thread

Back
Top Bottom