Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How can I change the date from '01/01/2016' to 'January 2016' format?

How can I change the date from '01/01/2016' to 'January 2016' format?

3 Replies
swuehl
MVP
MVP

You can use a format code like 'MMMM YYYY'  with a date() formatting function or as default date format code:

Date(DATEFIELD, 'MMMM YYYY')

Get the Dates Right

On Format Codes for Numbers and Dates

satishkurra
Specialist II
Specialist II

Try this

Date(monthstart(Date), 'MMMM-YYYY') as MonthYear

sunny_talwar

You can use MMMM or MMM and will depend on your environmental variables.

If you have this:

SET LongMonthNames='January;February;March;April;May;June;July;August;September;October;November;December';

Then Date(MonthStart(Datefield), 'MMMM YYY') as Datefield

In case your have this:

SET MonthNames='January;February;March;April;May;June;July;August;September;October;November;December';

Then Date(MonthStart(Datefield), 'MMM YYY') as Datefield or MonthName(Datefield) as DateField

It all depends on your ability and willingness to change the environmental variable. If you have access to the script and are willing to make a change, I would suggest using the second option with MonthName() function.

Best,

Sunny