Hi,
Ereplace( Trim(Oconv(@DATE, "D YMD")), " ", "") returns 3152004 instead of 03152004 where 03 is the month and 15 is the date. Correct me if any format is missed out.
The data should be in the below format
mmddyyyy
Date Format
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
For single-character replacement, Convert is more efficient than Ereplace.
The original YMD follows the default rule, returning the shortest possible string for each component. This is where the zero from the month vanished to. Specifying [4,2,2] forces the conversion to use that many digits for each comparison.
Another way to solve this problem is to do a double conversion. If you have a lot of these, create a Transform (which is then a re-usable component).
The "MCN" conversion causes only numeric characters to remain in the converted string.
The original YMD follows the default rule, returning the shortest possible string for each component. This is where the zero from the month vanished to. Specifying [4,2,2] forces the conversion to use that many digits for each comparison.
Another way to solve this problem is to do a double conversion. If you have a lot of these, create a Transform (which is then a re-usable component).
Code: Select all
Oconv(TheDate, "DYMD[4,2,2]":@VM:"MCN")
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.