If you are storing dates as 6 digits (yymmdd) in a *Text* field, create a
query and type an expression like this into the Field row:
TheMonth: Format(DateSerial(Left([d],2), Mid([d],3,2), Right([d],2)),
"MMM")
Replace the [d] with the name of your field.
Do not create another field in your table for this: doing so would be a
maintenance nightmare. By creating the field in the query, and using the
query instead of the table anywhere you need it (e.g. as the source for a
form or report), you never have to worry about it being wrong.
Of course, the data would be much more reliable if you used a Date/Time
field instead of a Text field. That will prevent nonsense dates such as
month 99 or day 30 of Feburary. It would also be much easier to perform date
math (e.g. days duration between 2 dates), and more efficient to
select/sort/query.
If you are using a Date/Time field, the query expression would be just:
Format([d], "MMM")
or you could even use the Format property of the field in the query (or of
the text box on your form/report.) Set it to:
MMM
or if you want to show the month in brackets after the date all in the one
field:
yy/mm/dd \(MMM\)
I store dates in my database in a field with yymmdd as the format. Is it
possible to then have a seperate column that displays the month of the
entry
as the 3 letter designator for the month?
For example if the date column reads 071121, can the next column read
"NOV"?