I am trying to get Date/Time values in a -SET. I need the beginning of the current month, end on the current month, and the beginnning of the current year. I normally do this with just a YYMD format, but the database I am querying is in HYYMDm format. Please help!
(Whate I normally do) -SET &BOM=DATECVT(( DATEMOV((DATECVT(&YYMD,'I8YYMD','YYMD')),'BOM')),'YYMD','I8YYMD'); -SET &EOM=DATECVT(( DATEMOV((DATECVT(&YYMD,'I8YYMD','YYMD')),'EOM')),'YYMD','I8YYMD'); -SET &BOY=DATECVT(( DATEMOV((DATECVT(&YYMD,'I8YYMD','YYMD')),'BOY')),'YYMD','I8YYMD');This message has been edited. Last edited by: Kerry,
WebFOCUS 768 OS/400 HTML, also quite a few active reports and excel.
December 29, 2010, 09:48 AM
Amber
Also, I've tried concatenating a time on the end of the date value, but receive an error.
SET TRACEOFF=ALL SET TRACEUSER=CLIENT SET TRACEON=STMTRACE//CLIENT -SET &BOM=DATECVT(( DATEMOV((DATECVT(20101229,'I8YYMD','YYMD')),'BOM')),'YYMD','I8YYMD'); -SET &EOM=DATECVT(( DATEMOV((DATECVT(20101229,'I8YYMD','YYMD')),'EOM')),'YYMD','I8YYMD'); -SET &BOY=DATECVT(( DATEMOV((DATECVT(20101229,'I8YYMD','YYMD')),'BOY')),'YYMD','I8YYMD'); -SET &BOY2=EDIT(20100101, '99999999') | ' 00:00:00.000000'; TABLE FILE ORDERS PRINT ID ORDERED_DATE REVENUE_CODE_ID STATUS WHERE ORDERED_DATE GE 20100101 00:00:00.000000; END 0 ERROR AT OR NEAR LINE 17 IN PROCEDURE mav_brokerage_batr (FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: 00:00:00.000000 BYPASSING TO END OF COMMAND (FOC009) INCOMPLETE REQUEST STATEMENT
WebFOCUS 768 OS/400 HTML, also quite a few active reports and excel.
December 29, 2010, 10:11 AM
Dan Satchell
Try this in your WHERE clause:
WHERE ORDERED_DATE GE DT(&BOY 00:00:00);
WebFOCUS 7.7.05
January 04, 2011, 03:37 PM
Amber
Thanks!
WebFOCUS 768 OS/400 HTML, also quite a few active reports and excel.