Month Function

  • Thread starter Thread starter Tamer Seoud
  • Start date Start date
T

Tamer Seoud

I have a report that a user has to run on the 10th every
month from a user interface.
The report has a control that should show the previous
month and the year. For example, if we are in January
2004, the control should show December 2003. I tried the
function Month(Now()-1), but it seems not working. Please
advise.
Thanks a million
Tamer
 
I have a report that a user has to run on the 10th every
month from a user interface.
The report has a control that should show the previous
month and the year. For example, if we are in January
2004, the control should show December 2003. I tried the
function Month(Now()-1), but it seems not working. Please
advise.
Thanks a million
Tamer

Tamer,
Take you pick....
=DateSerial(Year(Date()),Month(Date()),0)
returns 12/31/2003

=Format(DateSerial(Year(Date()),Month(Date()),0),"mmmm yyyy")
returns December 2003

or..

=DateAdd("m",-1,Date())
returns 12/12/2003

=Format(DateAdd("m",-1,Date()),"mmmm yyyy")
returns December 2003.
 
Tamar,

Try this...
=Format(DateAdd("m",-1,Date()),"mmmm yyyy")

- Steve Schapel, Microsoft Access MVP
 
Fred,
Many Thanks, it worked.
-----Original Message-----


Tamer,
Take you pick....
=DateSerial(Year(Date()),Month(Date()),0)
returns 12/31/2003

=Format(DateSerial(Year(Date()),Month(Date()),0),"mmmm yyyy")
returns December 2003

or..

=DateAdd("m",-1,Date())
returns 12/12/2003

=Format(DateAdd("m",-1,Date()),"mmmm yyyy")
returns December 2003.
--
Fred

Please reply only to this newsgroup.
I do not reply to personal e-mail.
.
 
Cheryl,
Thanks for your suggestion. The DateAdd() function helped
me to do what I wanted.
 
Steve,
Thanks a lot. It worked
-----Original Message-----
Tamar,

Try this...
=Format(DateAdd("m",-1,Date()),"mmmm yyyy")

- Steve Schapel, Microsoft Access MVP




.
 
Back
Top