Focal Point
Creating a date from characters and integers

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/7911019331

November 02, 2005, 02:18 PM
<bigpgo>
Creating a date from characters and integers
Hello all. What is the best way to create a YYM date from a table with:
1) year that is stored as A4, e.g. "2005"
2) month that is stored as I2, e.g. 9

(I'm not using SQL passthrough - just regular webFOCUS functions). Thanks in advance.
November 02, 2005, 02:38 PM
Francis Mariani
DEFINE FILE CAR
TYEAR/A4 = '2005';
TMONTH/I2 = 9;
TDATEX/A6YYM = TYEAR | EDIT(TMONTH);
TDATE/YYM = TDATEX;
END
TABLE FILE CAR
PRINT TDATE
BY COUNTRY
END
November 02, 2005, 02:50 PM
mgrackin
Off the cuff, I would try:

ALPHADATE/A6YYM=YEARA4 | EDIT(MTHI2);
SMARTDATE/YYM=ALPHADATE;
November 02, 2005, 02:51 PM
<bigpgo>
That works! Thanks a lot.