Focal Point
[SOLVED] How to convert A10 to YYMD?

This topic can be found at:
http://forums.informationbuilders.com/eve/forums/a/tpc/f/1381057331/m/1857097676

June 17, 2015, 03:05 PM
Max Nevill
[SOLVED] How to convert A10 to YYMD?
Hi all. I'm using release R727703B and I'm trying to convert an Academic Year in an A7 format i.e. "2004-05" to a YYMD for calculating date differences.


My thought was to do this:
EDIT(EDIT( A_PERIOD,'9999') | '/09/01'))
which creates 2004/09/01 in an A10 Format and then edits it into YYMD. Unfortunately the software doesn't like this and spits out blanks.

I then thought to do

EDIT(EDIT( F_PERIOD,'9999') | '0901') and put it into an I8YYMD format, but again, the software doesn't like this and only wants to spit out A8 format.

Any suggestions?

This message has been edited. Last edited by: <Kathryn Henning>,


WebFocus 8.104
Windows 7 Entreprise, SP1
June 17, 2015, 04:00 PM
Dan Satchell
Try this:

A_DATE/A8YYMD = EDIT(A_PERIOD,'9999$99') | '01';
S_DATE/YYMD   = A_DATE ;



WebFOCUS 7.7.05
June 17, 2015, 04:49 PM
Max Nevill
quote:
Originally posted by Dan Satchell:
Try this:

A_DATE/A8YYMD = EDIT(A_PERIOD,'9999$99') | '01';
S_DATE/YYMD   = A_DATE ;


Good suggestion, I unfortunately get blanks in my S_DATE transform.


WebFocus 8.104
Windows 7 Entreprise, SP1
June 18, 2015, 02:49 PM
Dan Satchell
This works for me:

DEFINE FILE CAR
 A_PERIOD/A7 WITH COUNTRY = '2004-05';
 A_DATE/A8YYMD = EDIT(A_PERIOD,'9999$99') | '01';
 S_DATE/YYMD   = A_DATE ;
END
-*
TABLE FILE CAR
 PRINT A_PERIOD A_DATE S_DATE
 WHERE RECORDLIMIT EQ 1 ;
END



WebFOCUS 7.7.05
June 18, 2015, 08:50 PM
Alan B
Dan's suggestion should work unless there is something else there.

You could always try DATEPATTERN in the MFD.


Alan.
WF 7.705/8.007
June 26, 2015, 03:03 PM
Max Nevill
Thanks guys, this is what I needed.


WebFocus 8.104
Windows 7 Entreprise, SP1