DLookup Criteria

D

David

I am trying to run a report from a form looking for records that are older
than the number of days entered in a control on the form (the control in
called days.) Before I ran the report, I wanted to validate, through a
DLookup function, that there were records in the dataset.

IN the criteria, I need to look for records which meet the following:

The [RelDate] field is Null and the [EnteredDate] field is older than (less
than) the current date less the amount of days entered on the form.

I was trying something like:
"[RelDate] Is Null And [EnteredDate] < Format(Date()- Me.Days,
"\#mm\/dd\/yyyy\#")"

I know I am way off on this, so any help would be appreciated.
 
K

Ken Snell

This may work:

"[RelDate] Is Null And DateDiff(""d"", [EnteredDate], Date() - " & Me.Days
& ) < 0"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top