Many times in the dim dark past, I have seen and, I must admit, done the following to format a date into YYYYMMDD format:
DISPLAY.DTE = OCONV(@DATE, "D4Y") : OCONV(@DATE, "DM") 'MR%2' : OCONV(@DATE, "DD") 'MR%2'
Or something similar.
But it is possible to do the following:
DISPLAY.DTE = OCONV(@DATE, "D4YMD[4'', 2'', 2]")
How does it work?
Well, the D4YMD means to format the year as 4 digits, place Year first, followed by Month then Day.
The [4”, 2”, 2] formats the YMD (in that order) to 4 digits long for the year, followed by a empty string (” – two single quotes), followed by 2 digits for the month, a empty string, and then last 2 digits for the day.
If the empty strings are not supplied, the default is to separate the fields by a space.
See help at ECL
HELP CONV D
or your local manual hoarder.
0 Comments