date problem

J

Jeff Hughes

Is there a way for access to automatically work out the 1st and last day of
the previous month without having to manually do anything and then use this
info to run queries etc???

thanks
 
A

Allen Browne

Last day of last month is:
Date() - Day(Date())

First of last month is:
DateAdd("m", -1, Date() - Day(Date()) + 1)
 
J

John Vinson

Is there a way for access to automatically work out the 1st and last day of
the previous month without having to manually do anything and then use this
info to run queries etc???

DateSerial(Year(Date()), Month(Date()) - 1, 1)
DateSerial(Year(Date()), Month(Date()), 0)

respectively
 
Top