Problem with my query expression

  • Thread starter Thread starter Adam
  • Start date Start date
A

Adam

Hi,

I have a query which looks at a form and searches between a range of
dates.

The expression I've been given to put into my query is as follows:

WHERE ([ContactDate] >= CDate([Forms]![Open Contact frm]![StartDate])
OR [Forms]![Open Contact frm]![StartDate] IS NULL)
And
([ContactDate] < DateAdd("d", 1, CDate([Forms]![Open Contact
frm]![EndDate]) OR [Forms]![Open Contact frm]![EndDate] IS NULL)


This is giving me the error message "The expression you have entered is
missing a closing parenthesis bracket (]), or vertical bar(|)."

Does anyone know whats wrong with this expression?

I'm using Access 97.

Adam
 
WHERE ([ContactDate] >= CDate([Forms]![Open Contact frm]![StartDate])
OR [Forms]![Open Contact frm]![StartDate] IS NULL)
And
([ContactDate] < DateAdd("d", 1, CDate([Forms]![Open Contact
frm]![EndDate]) OR [Forms]![Open Contact frm]![EndDate] IS NULL)

This is giving me the error message "The expression you have entered is
missing a closing parenthesis bracket (]), or vertical bar(|)."

Does anyone know whats wrong with this expression?

You have 5 opening parenthesis '(' and 4 closing parenthesis ')'
At a glance it looks as though you haven't put a double '))' to close the
DateAdd and CDate functions.
 
The count of opening & closing parentheses as well as square brackets looks
fine.

The problem may be in the other parts of the SQL String.
 
I'm having trouble getting this to work now.

Do I just paste this into the SQL code so the WHERE creates my criteria?
 
Back
Top