Formatting dates

J

Johanna Gronlund

Hello,

I have a table with dates in the following format: YYYY/MM

What I would like to do, is to have a report that has activity per month. I
am planning to have one report per year (which I know how to do). However,
what I am struggling with is to come up with a way that will show the months
in my report as nice headers in letters, e.g. January, February, etc.

Thanks for your help in advance!

Johanna
 
J

Jeff Boyce

"... dates in the following format ..." could mean that your table actually
holds Date/Time values in that field, said values being formatted for
display to show as "YYYY/MM" ...

But it could also mean that your table has a text field that shows something
some folks interpret as dates ... Dates, though, have days, as well as
months and years.

Which way is your table set up?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

John Spencer

Year and Month is not a date.

You can try the following expression:

Format(CDate([YYYYmmStringField]),"mmmm")

CDate is "smart" enough to guess that yyyy/mm is a year and a month and will
convert the string to the first day of the specified month and year. The
DateValue will also work to do the conversion.


John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 

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

Top