[SOLVED] convert character date of mm/dd/yyy format to date format of mm/dd/yyyy
I have a master file date in char (A20V) format of mm/dd/yyy. I need to convert it to yymmdd so I can select MIN date.
I tried this (one of many trys)
DEFINE FILE WKFLOW_DOC_TYPE_FACT
OldEndDate/A20=CHGDAT('MDYY', 'YYMD',WKFLOW_DOC_TYPE_FACT.WKFLOW_DOC_TYPE_FACT.DISPLAYMMYY, 'A8'); END
And when I use is it is blank.. Any help is greatly appreciatedThis message has been edited. Last edited by: Kerry,
WebFOCUS 7.7.03 Windows 7
October 13, 2011, 05:49 PM
Francis Mariani
quote:
mm/dd/yyy
More details please: Does it contain slashes? It's not really yyy, is it?
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
October 13, 2011, 05:49 PM
Waz
quote:
mm/dd/yyy
How is the date formatted ?
Do you have an example ?
Waz...
Prod:
WebFOCUS 7.6.10/8.1.04
Upgrade:
WebFOCUS 8.2.07
OS:
Linux
Outputs:
HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!
October 13, 2011, 05:57 PM
Brenda Wilkerson
Sorry, got carried with my y's
It is formated st follows: 09/29/2011
WebFOCUS 7.7.03 Windows 7
October 13, 2011, 06:07 PM
Francis Mariani
So, just to be sure, that A20V column has data that contains the slashes?
If so, try the following:
TABLE FILE CAR
PRINT
COMPUTE DISPLAYMMYY/A20V = '09/29/2011';
COMPUTE OLDENDDATE1/A8MDYY = EDIT(DISPLAYMMYY,'99$99$9999');
OLDENDDATE/YYMD = OLDENDDATE1;
BY COUNTRY
END
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
Having the DATEPATTERN will allow you to set the usage to what ever you need: YYMD, MtrDYY, etc.
Windows: WF 7.6.2: SQL Server 2008 R2
October 14, 2011, 10:01 AM
Brenda Wilkerson
I tried your example and When I clcked the run button it doesn't run, there are no errors. I also found that there are some records that are mm/dd (01/23).
My code below, maybe I am missing something?
TABLE FILE WKFLOW_DOC_TYPE_FACT COMPUTE DISPLAYMMYY/A20V = '09/29/2011'; COMPUTE OLDENDDATE1/A8MDYY = EDIT(DISPLAYMMYY,'99$99$9999'); OLDENDDATE/YYMD = OLDENDDATE1; SUM WKFLOW_DOC_TYPE_FACT.WKFLOW_DOC_TYPE_FACT.OLDENDDATE J3.TRAN_TYPE_DIM.TRAN_TYPE_NM WKFLOW_DOC_TYPE_FACT.WKFLOW_DOC_TYPE_FACT.DISPLAYMMYY WKFLOW_DOC_TYPE_FACT.WKFLOW_DOC_TYPE_FACT.ACTIVE WKFLOW_DOC_TYPE_FACT.WKFLOW_DOC_TYPE_FACT.PEND BY LOWEST J0.USER_DIM.USER_ID BY LOWEST J2.NODE_DIM.NODE_NM BY LOWEST WKFLOW_DOC_TYPE_FACT.WKFLOW_DOC_TYPE_FACT.DISPLAYMMYY NOPRINT WHERE J3.TRAN_TYPE_DIM.TRAN_TYPE_CD EQ 'E'; ON TABLE SET PAGE-NUM NOLEAD ON TABLE NOTOTAL ON TABLE PCHOLD FORMAT HTML ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * INCLUDE = endeflt, $ TYPE=REPORT, COLUMN=N1, SQUEEZE=1.680556, $ TYPE=REPORT, COLUMN=N2, SQUEEZE=1.430556, $ ENDSTYLE END
WebFOCUS 7.7.03 Windows 7
October 14, 2011, 10:55 AM
Brenda Wilkerson
Got it resolved. Put it in a define and date is converted.