Using dates in the selection criteria (1 Viewer)

MarionD

Registered User.
Local time
Today, 04:49
Joined
Oct 10, 2000
Messages
421
Hi all

I have a problem with selecting certain records to print in a report,
My aim is to print all Orders that have no delivery date and where the expected Delivery date is < todays date.

I have tried this :

Printkriteria = "IsNull([DateDelivered])" & "and " & "ExpectedDelivery< " & Date

But it has a problem with the isnull part?

Help! I need somebody;)
 

Minty

AWF VIP
Local time
Today, 04:49
Joined
Jul 26, 2013
Messages
10,371
That should probably be

Printkriteria = "[DateDelivered] IS NULL AND [ExpectedDelivery] < DATE() "

You don't need to concatenate it as Date is an inbuilt function.

IsNull() is used in VBA for checking values, not in a WHERE clause.
 

Users who are viewing this thread

Top Bottom