Focal Point
[SOLVED] Date conversion

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

February 08, 2010, 03:04 AM
Chris Austin
[SOLVED] Date conversion
I'm trying to turn three text fields into a MDYY format date field. The source field is

NXTCPNDT /A20 = '2010-05-15 00:00:00'

This is what I have tried

NXTCPNMO /A2 = EDIT(NXTCPNDT,'$$$$$$$$99$$$$$$$$$$');
NXTCPNDAY /A2 = EDIT(NXTCPNDT,'$$$$$99$$$$$$$$$$$$$');
NXTCPNYEAR /A4 = EDIT(NXTCPNDT,'9999$$$$$$$$$$$$$$$$');
NXTCPN /A10 = NXTCPNMO||'/'||NXTCPNDAY||'/'||NXTCPNYEAR;
NXTCPNDT /MDYY = EDIT(NXTCPN);

I just need to assemble the three pieces and convert to MDYY to use in calculations vs other dates that are in MDYY format. Thank you for your help!

This message has been edited. Last edited by: Kerry,


DevStudio 766 Servlet - Self Service - MS Windows XP SP2, (output) Excel, PDF, HTML
February 08, 2010, 03:41 AM
GamP
So close ....
NXTCPNMO /A2 = EDIT(NXTCPNDT,'$$$$$$$$99$$$$$$$$$$');
NXTCPNDAY /A2 = EDIT(NXTCPNDT,'$$$$$99$$$$$$$$$$$$$');
NXTCPNYEAR /A4 = EDIT(NXTCPNDT,'9999$$$$$$$$$$$$$$$$');
NXTCPN /A8MDYY = NXTCPNMO||NXTCPNDAY||NXTCPNYEAR;
NXTCPNDT /MDYY = NXTCPN;



GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
February 08, 2010, 04:06 AM
Dan Satchell
Another approach:

NXTCPNDT/A20 = '2010-05-15 00:00:00';
DATE_HYYMDS/HYYMDS = HINPUT(14,NXTCPNDT,8,DATE_HYYMDS);
DATE_MDYY/MDYY     = HDATE(DATE_HYYMDS,'MDYY');


But, if your beginning value can be made available in a variable, you may save processing time by using Dialogue Manager to make the transformation just once, and avoid performing the transformation for every record in your table:

-SET &NXTCPNDT  = '2010-05-15 00:00:00';
-SET &DATE_MDYY = EDIT(&NXTCPNDT,'$$$$$99$') | '/' | EDIT(&NXTCPNDT,'$$$$$$$$99$') | '/' | EDIT(&NXTCPNDT,'9999$');

This message has been edited. Last edited by: Dan Satchell,


WebFOCUS 7.7.05
February 08, 2010, 05:16 AM
Chris Austin
Thank You!!!

I'm back on track.


DevStudio 766 Servlet - Self Service - MS Windows XP SP2, (output) Excel, PDF, HTML