Problem with my query expression

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
 
P

Peter Hoyle

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.
 
V

Van T. Dinh

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.
 
A

Adam

I'm having trouble getting this to work now.

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

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