Providing Date for Selection in Query

  • Thread starter Thread starter Peter
  • Start date Start date
P

Peter

Hi

I have a table which contains tasks with due date. If I
want to find all those task that are due within the next
60 days I can put the expression

<=Date()+60

under the due date field and that works fine. However, I
thought it would be nice to allow the user to provide the
date they want to start with (rather than using system
date) and tried the expression:

<=[SearchDate] + 60

and though I can enter a date into the prompt box which
appears, the query fails with the error that it's too
complex.

Anyone any idea what's wrong with the expression?

Thanks in advance for any posting.
Peter
 
Hi

You need to declare your parameter so that you can use it
in calculations.

Add the following at the start of your SQL:-

PARAMETERS [SearchDate] DateTime;


hth

Chris
 
Back
Top