Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

month() function 1

Status
Not open for further replies.

OhioSteve

MIS
Mar 12, 2002
1,352
US
Hi!

I use the month() function frequently. It returns an integer based on the month of a date value. My question is, how do I return the month as a normal word? I want to write something like month(date()), but I want the value to be "October", not 10. Obviously I could make a small table with integers and month names, and then do a dlookup()...but is there an easier method???
 
format(month(date()), "mmmm") Please remember to give helpful posts the stars they deserve!
This makes the post more visible to others in need! [thumbsup2]

Robert L. Johnson III, A+, Network+, MCP
Access Developer/Programmer
robert.l.johnson.iii@citigroup.com
 
I just tried your suggestion and it almost
worked. I mades two text boxes in my report.
This was the result....

text box:
test1

control source:
=Month(#7/4/2002#)

output:
7

text box:
test2

control source:
=Format(Month(#7/4/2002#),"mmmm")

output:
"January"

I made sure that the format property was blank
in both text boxes. Test2 output seems to always be
"January" (I also tried other values).

Any comments????
 
Hi!

Try this:

=Format(#7/4/2002#,"mmmm")

hth

Jeff Bridgham
bridgham@purdue.edu
 
jebry, you are the man!

I found that your suggestion DOES extract the month as a word, and makes its data type text. After a little experimentation, I found the following:

change "mmmm" to "yyyy"....returns "2002" as text

change "mmmm" to "dddd"....returns "Thursday" as text

change "mmmm" to "long date"....returns "Thursday, July 4, 2002" as text

I want to make a title that will say something like "Widget Production in the Month of September". This should meet that need.
 
You can also use Format to get custom dates and numbers...

for example Format(Date(), "mmmm dd, yyyy") will give you March 07, 2002 and Format(123456789, "#,##0.00") would give you 123,456,789.00

Take a look at the help file for format....very powerful Please remember to give helpful posts the stars they deserve!
This makes the post more visible to others in need! [thumbsup2]

Robert L. Johnson III, A+, Network+, MCP
Access Developer/Programmer
robert.l.johnson.iii@citigroup.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top