View Full Version : Date code to Month name


ggodwin
02-13-2009, 06:25 AM
I have the below query
SELECT [DENSO Plants].[DENSO Plant name], SkpiProblemLog.SupplierCode, SkpiProblemLog.NAMC, SkpiProblemLog.Type, SkpiINVESTIGATION.Responsible, SkpiProblemLog.Date
FROM (SkpiProblemLog INNER JOIN SkpiINVESTIGATION ON SkpiProblemLog.ScrapRecordTag = SkpiINVESTIGATION.ScrapRecordTag) INNER JOIN [DENSO Plants] ON SkpiINVESTIGATION.SupplierCode = [DENSO Plants].[Supplier Code]
WHERE (((SkpiINVESTIGATION.Responsible)="Non-DENSO"));

I would like to add another step to this if possible.

I have this record "SkpiProblemLog.Date". This record gives me a date.
I would like to have this field either add a field called month or convert my date field to month.

I prefer to add the field "month".

Basically this step will convert date field to the month that the date represents.

Example:
1-20-09 = January
2-14-09 = February

etc...

MSAccessRookie
02-13-2009, 06:37 AM
I have the below query
SELECT [DENSO Plants].[DENSO Plant name], SkpiProblemLog.SupplierCode, SkpiProblemLog.NAMC, SkpiProblemLog.Type, SkpiINVESTIGATION.Responsible, SkpiProblemLog.Date
FROM (SkpiProblemLog INNER JOIN SkpiINVESTIGATION ON SkpiProblemLog.ScrapRecordTag = SkpiINVESTIGATION.ScrapRecordTag) INNER JOIN [DENSO Plants] ON SkpiINVESTIGATION.SupplierCode = [DENSO Plants].[Supplier Code]
WHERE (((SkpiINVESTIGATION.Responsible)="Non-DENSO"));

I would like to add another step to this if possible.

I have this record "SkpiProblemLog.Date". This record gives me a date.
I would like to have this field either add a field called month or convert my date field to month.

I prefer to add the field "month".

Basically this step will convert date field to the month that the date represents.

Example:
1-20-09 = January
2-14-09 = February

etc...

Take a look at the Format() command. I believe it can do what you want

RuralGuy
02-13-2009, 06:40 AM
Have you tried MonthName(Month([YourDateField])) As TheMonth?

MSAccessRookie
02-13-2009, 06:44 AM
Have you tried MonthName(Month([YourDateField])) As TheMonth?

I forgot all about MonthName. I was suggesting format(YourDateField, "mmmm"), which I believe does the same thing.

RuralGuy
02-13-2009, 06:51 AM
Lots of ways to skin a cat in Access, as the MissingLinq likes to say.