Setting A Default Date Value

pgc72

New member
Local time
Today, 18:57
Joined
Dec 13, 2006
Messages
4
I have a query where I am look at data for a period that is before or equal to the last day of the previous month. To obtain this data I currently have a criteria of "<=[Last Day Of Month]". This involves typing in the last day of the month previous month. As I will be running this query late at might and will not be around to enter the details I am trying to find a solution where the criteria will automatically set the last day of the month for me.

Does anyone have any suggestions?

thanks
 
Hi -

Last day of previous month:

DateSerial(year([dteMyDate]), month([dteMyDate]), 0)

HTH - Bob
 
Thanks Bob,

I tried that but it didn't work, tried that in a table and it worked fine. Might be because I am using it in the criteria area of the query in a date field. However I did come up with a solution that worked:

<=DateAdd("d",-Day(Date()),Date())
 

Users who are viewing this thread

Back
Top Bottom