Formatting a Date Field
Moderators: Dorian (MJT support), JRL
Formatting a Date Field
I have a date field that can either be mm/dd/yyyy or mm/dd/yy and in either case i want to convert this to a string of mmddyy. Is there a formatting date option that i can use?
-
- Automation Wizard
- Posts: 1101
- Joined: Fri Jan 07, 2005 5:55 pm
- Location: Somewhere else on the planet
Is it text? If so you can do this:
If you are going to eventually sort/index by the dates then yyyymmdd is a more useful format.
Code: Select all
//Works with 01/31/2009 or 01/31/09 dates
Let>mydate=01/31/2009
StringReplace>mydate,/,,date2
Len>date2,mylen
If>mylen=6
Let>newdate=date2
Goto>alldone
EndIf
Midstr>date2,1,4,newdate
Midstr>date2,7,2,yy
ConCat>newdate,yy
Label>alldone
MDL>newdate