Formatting dates

  • Thread starter Thread starter Johanna Gronlund
  • Start date Start date
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
 
"... 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
 
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
 
Back
Top