I would like to create a report for all of employees, who were not present in certain period.
In my report I only use the Workers table, since none of the CR table linking options seem to work to link it to the Presence table. Therefor I'm using SQL expression in my report. The report works fine, when I type in the "from" and "to" date.
What I would like to do, is to declare the dates as variables (@From, @To), so when I refresh my report I would have to enter the values for the two dates.
Here is my SQL select expression:

SELECT WID, Name
FROM Workers
WHERE not exists
(Select pWID
From presence
where pWID = WID and pDate between @FromDate and @ToDate);

I defined @FromDate and @ToDate as formulas or parameters in report field explorer, but I still got an error message saying "Must declare the scalar variable @From".

I'm using CR8.0 and SQL2005

Thanks a lot