Hi Folks,
I've searched around and read a fair deal of posts regarding date formats. I understand how they tie to the system settings but I'm not able to find a post that addresses my need to format a date with the month spelled out. I know in some of my excel code I can specify a date format as MMMM and it returns 'June'. Can I accomplish this in MS? Can someone help point me in the right direction?
TIA
Date Format Problem
Moderators: JRL, Dorian (MJT support)
Re: Date Format Problem
Well I came up with something that I don't think is pretty but it works... I'd love to hear how others have solved this problem, I can't be the only one.

Code: Select all
Month>m
If>m=01
mm=January
ELSE
IF>m=02
Let>mm=February
ELSE
IF>m=03
Let>mm=March
ELSE
IF>m=04
Let>mm=April
ELSE
IF>m=05
Let>mm=May
ELSE
IF>m=06
Let>mm=June
ELSE
IF>m=07
Let>mm=July
ELSE
IF>m=08
Let>mm=August
ELSE
IF>m=09
Let>mm=September
ELSE
IF>m=10
Let>mm=October
ELSE
IF>m=11
Let>mm=November
ELSE
IF>m=12
Let>mm=December
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
Day>d
Let>dd=d-1
Year>y
MessageModal>File name is %mm% %dd% %y%
- Grovkillen
- Automation Wizard
- Posts: 1132
- Joined: Fri Aug 10, 2012 2:38 pm
- Location: Bräcke, Sweden
- Contact:
Re: Date Format Problem
Code: Select all
GoSub>MONTHS_FIX
Month>MONTH_NUMBER
MidStr>1,1,TEST
If>TEST=0
MidStr>2,1,MONTH_NUMBER
EndIf>
Let>VERBOSE_MONTH_NAME=MONTH_NAME_%MONTH_NUMBER%
SRT>MONTHS_FIX
Let>RAW_LIST=January|February|March|April|May|June|July|August|September|October|November|December
Separate>RAW_LIST,|,MONTH_NAME
END>MONTHS_FIX
Re: Date Format Problem
Ahh, much cleaner, thank you very much!Grovkillen wrote: ↑Thu Jun 06, 2019 8:04 pmCode: Select all
GoSub>MONTHS_FIX Month>MONTH_NUMBER MidStr>1,1,TEST If>TEST=0 MidStr>2,1,MONTH_NUMBER EndIf> Let>VERBOSE_MONTH_NAME=MONTH_NAME_%MONTH_NUMBER% SRT>MONTHS_FIX Let>RAW_LIST=January|February|March|April|May|June|July|August|September|October|November|December Separate>RAW_LIST,|,MONTH_NAME END>MONTHS_FIX
Re: Date Format Problem
Code: Select all
month>m
vbeval>monthname(%m%),vMoName
vbeval>monthname(%m%,true),vMoNameShort
- Grovkillen
- Automation Wizard
- Posts: 1132
- Joined: Fri Aug 10, 2012 2:38 pm
- Location: Bräcke, Sweden
- Contact:
Re: Date Format Problem
Great JRL! I guess my example could be useful in generic ways of doing conversions while yours is great in this specific question.