[SOLVED] today minus 1 day function in where clause.
I'm trying to subtract 1 day from the current day and use it in a where clause. I'm confused on the format. The ENTDATE and DATE define fields work but I can't get the DAYAGO define to work. I also tried using the AYMD function. Can someone please assist.
DEFINE FILE INFO
ENTDATE/HMDYY=ENTRYDATE
DATE/A10=TODAY(DATE);
DAYAGO/MDYY=DATEADD(DATE, 'D', -1);
END
TABLE FILE INFO
NAME
ADDRESS
ENTDATE
WHERE ENTDATE EQ DAYAGO;
This message has been edited. Last edited by: kitten,
WebFOCUS 7.6.2, MS Windows Server/______, Excel, PDF, HTML
April 08, 2013, 12:40 PM
Doug
For starters, 1) add a semicolon at the end of this line: "ENTDATE/HMDYY=ENTRYDATE", 2) Add "DAYAGO" to your print line, 3) remove the WHERE statement, 4) Add a RECORDLIMIT and END, and see if "DAYAGO" is what you expect it to be, 5 take from there. and
April 08, 2013, 12:46 PM
kitten
Oops. I did have the semicolon at the end just didn't copy it over. I also tried to print the DAYAGO field but get the following error: INVALID TYPE OF ARGUMENT #1 FOR USER FUNCTION DATEADD.
Should I have used the AYMD function?
WebFOCUS 7.6.2, MS Windows Server/______, Excel, PDF, HTML
April 08, 2013, 01:01 PM
Tom Flynn
Change DATE/A10=TODAY(DATE); to DATE/YYMD = '&DATEYYMD.EVAL';
That worked Tom, but the where clause doesn't. I get the following error: (FOC280) COMPARISON BETWEEN COMPUTATIONAL AND ALPHA VALUES IS NOT ALLOWED (FOC009) INCOMPLETE REQUEST STATEMENT
Do I need to convert the ENTDATE to Alpha?
WebFOCUS 7.6.2, MS Windows Server/______, Excel, PDF, HTML
April 08, 2013, 02:53 PM
Tom Flynn
Change:ENTDATE/HMDYY=ENTRYDATE; To: ENTDATE/MDYY=ENTRYDATE;
For the WHERE test, need to have the same format; apples-to-apples, oranges-to-oranges, etc...