Display Last month

T

tminn

I am putting two calendars off to the side of my database for the purposes of
reference for the user. I want one to display this month, and one to display
last month. What I can't figure out is, what should the control source be
for the one that displays last month? If I use =Date-30 then it wouldn't
work right for certain months (Feb, etc.). There's got to be a way to tell
it "last month," right? Thanks in advance.
 
K

Klatuu

=dateserial(year(date),Month(date),-1)
Will return the date of the last day of the previous month.
 
T

tminn

Thanks, that worked great... Any thoughts on how I could set one to show next
month as well? (That is, the month after the current month?)
 
V

Van T. Dinh

.... and DateSerial(Year(Date()), Month(Date()) + 1, 1) will return the first
of next month.
 
Top