-SET &DAYIN = '070523';
-SET &DAYIN = '20' || &DAYIN;
DEFINE FILE CAR
DATEIN/YYMD = &DAYIN;
END
TABLE FILE CAR
PRINT DATEIN
BY MODEL
IF RECORDLIMIT EQ 5
END
or with the year threshold to get it in the year 2000
SET DEFCENT=19
SET YRTHRESH=56
-SET &DAYIN = '070523';
DEFINE FILE CAR
DATEIN/YYMD = &DAYIN;
END
TABLE FILE CAR
PRINT DATEIN
BY MODEL
IF RECORDLIMIT EQ 5
END
*thanks Alan B for that one.. I knew it was simple... just never needed it.This message has been edited. Last edited by: Leo L,
Prod: WebFOCUS 7.6.4 - Self Service - Windows Server2003 - Apache Tomcat 5.5 Dev: WebFOCUS 7.6.4 - Self Service - Windows XP SP2 - Apache Tomcat 5.5
June 15, 2007, 02:48 PM
Alan B
Nick forgot to put a format on, that's all.
LETTING/YYMD=DATECVT('&LETTING','A6YMD','YYMD');
You may want to SET DEFCENT=19 and SET YRTHRESH=56 as well.
Alan. WF 7.705/8.007
June 15, 2007, 03:08 PM
Leah
quote:
The alpha format is: 070523, YMD.
Using defines, this works too; -SET &LETTING= 070515; SET DEFCENT=19 SET YRTHRESH=56
DEFINE FILE EMPLOYEE IDATE1/I6YMD = EDIT('&LETTING'); MYDATE/YYMD=IDATE1; END TABLE FILE EMPLOYEE SUM CURR_SAL FST.IDATE1 FST.MYDATE END
Leah
June 15, 2007, 03:25 PM
Mike Johnson
Not sure what I'm doing wrong but none of the suggestions are working.
SET DEFCENT=19 SET YRTHRESH=56 DEFINE FILE EMPLOYEE NDATE/A6 = EDIT ('$LETTING', '$$999999'); NLETDATE/I6 = EDIT(NDATE); LETTING/YYMD = NLETDATE; -*LETTING/YYMD=DATECVT('&LETTING','A6MDY','YYMD'); END
Don't forget that &LETTING = 'CT070523' NOT '070523'
June 15, 2007, 03:29 PM
Mike Johnson
quote:
SET DEFCENT=19 SET YRTHRESH=56 -SET &DAYIN = '070523'; DEFINE FILE CAR DATEIN/YYMD = &DAYIN;
Sorry, I overlooked one sugguestion. the following one worked Thanks alot for the quick response.
SET DEFCENT=19 SET YRTHRESH=56 -SET &DAYIN = '070523'; DEFINE FILE CAR DATEIN/YYMD = &DAYIN;
February 05, 2010, 03:53 PM
nsk110483
Hi All,
My date format is 2009/10/23 how to convert the same to 200910
In Focus since 2008 WebFOCUS 8.2.0.1 Windows 7 - IE,Chrome,Firefox Excel, PDF, HTML, AHTML, XML JavaScript, jQuery, D3.js, Highcharts
February 05, 2010, 04:28 PM
Dan Satchell
If your date is in an ampersand variable, you can use the EDIT function:
-SET &NEWDATE = EDIT(&OLDDATE,'9999$99$$$');
WebFOCUS 7.7.05
February 05, 2010, 05:29 PM
njsden
If it isn't an ampersand variable but an actual date field instead, then you will need to convert it from DATE to ALPHA and then extract the pieces you need.
Please review the documentation for DATECVT and other DATE functions which you will surely need in the future.