DatePart Display Month Name

G

Guest

I have been able to use the DatePart function to display the month with
summary data attached. I have used Expr1 in the query to create the month
Expr1: DatePart("m",[dtmAmbulanceAuditDate]). The problem is that I can only
get it to display the month as a numeral eg "3" for March. All of my dates
are formatted as short date dd/mm/yyyy. Is there a way to force Access to
show the actual month eg "March" on reports?
 
L

Larry Linson

Expr1: DatePart("m",[dtmAmbulanceAuditDate]).
The problem is that I can only get it to display
the month as a numeral eg "3" for March. All of
my dates are formatted as short date dd/mm/yyyy.
Is there a way to force Access to show the actual
month eg "March" on reports?

3 is also the "actual month". <GRIN>

Use the Format function to return the abbreviation or full name of the
month, as follows (copied from the Immediate Window of Access 2003):

? Format(#3/11/2004#,"Mmm")
Mar
? Format(#3/11/2004#,"Mmmm")
March

In the calculation use =Format([datefieldsname],"Mmmm").

You could, perhaps, join with a month-name-lookup-table, but it'd be more
work and overhead.

Larry Linson
Microsoft Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top