July 01, 2004, 08:19 PM
<turtle>how to compare today's date to a DB date field in a report's where condition
Hello,
I have tried a number of things, but none of them work. I would like to put a where condition on my report that compares today's date with a date field in my DB table.
I've tried something like this:
datedif &mdyy, datefield, 'D' < 0
but it did not work, nor did something along the lines of:
today ge datefield
When I used the 'Assist' feature, it didn't seem to let me choose anything except a specific date, so that's when I started trying out other things.
Does anyone have any suggestions?
Thanks in advance.
July 01, 2004, 08:34 PM
<WFUser>You can create a defined field of the same format and compare them.
DEFINE FILE filename
TODAY/MDYY = &MDYY;
END
TABLE FILE filename
PRINT ...
WHERE DBFLD EQ TODAY
END
But a more efficient way would be to treat today's date as a literal
IF DBFLD EQ '&MDYY'