EVAL numericField = %dec(%date(alphaDate:*MDY/):*MDY)
The parm following the char field must be the format of the char field (I used *MDY with "/"for an example).
The parm at the end of the expression must be the format of the numeric field.
So this example converts 11/22/2008 to 11222008.
If you want 2008-11-22 converted to 20081122 make both parms *ISO.
Give an example of what you want and we can be more specific.
Last Wiki Answer Submitted: June 13, 2008 10:45 pm by graybeard523,115 pts.
All Answer Wiki Contributors: graybeard523,115 pts.
If you live outside the United States, by submitting your email address you consent to having your personal data transferred to and processed in the United States.
Why would you convert to Numeric? If it’s a date, then convert to a Date data type instead. (I can guess at least one answer — “Because the file doesn’t define it as a Date. Instead it defines it as Numeric.” Sigh.)
Why would you convert to Numeric? If it’s a date, then convert to a Date data type instead. (I can guess at least one answer — “Because the file doesn’t define it as a Date. Instead it defines it as Numeric.” Sigh.)
Tom
This from a program that updates a (software vendor’s) file:
The InDate field is character information coming from a fixed format .txt file.