Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

criteria used in query

Status
Not open for further replies.

bnageshrao

Programmer
Mar 17, 2001
83
US
In access query when I put the value of “Referral - AC (H&W)” in the criteria field I am getting the following error.

The expression you entered has an invalid .(dot) or! Operator or invalid parentheses
You may have entered an invalid identifier or typed parentheses following null constant.

I have to get all records from the table where field value = "Referral - AC (H&W)”.

Is there a way I can run the query?. Do I have to use any single quotes around parentrheses or is there any wild chaarcters? Any help is higly appreciated
 


Hi,

Enter that string in [tics]
[tt]
'Referral - AC (H&W)'
[/tt]



Skip,
[sub]
[glasses] [red]Be Advised![/red]
A wee deranged psychic may be runnin' around out there!
SMALL MEDUIM @ LARGE[tongue][/sub]
 
Let's see your SQL statement...I tested it on my end and it shouldn't be a problem. Could be a typo.
 
Here is the sql statement
IIf([leadforpicklist]![LEADSOURCE]= “OneSource”, “OneSource”, IIf([leadforpicklist]![LEADSOURCE]= “Sales Rep Generated”, “Sales Rep Generated”, IIf([leadforpicklist]![LEADSOURCE]= “Marketing
”, “Marketing”, IIf([leadforpicklist]![LEADSOURCE]= ‘Referral - AC (H&W)’, ‘Referral - AC (H&W)’, IIf([leadforpicklist]![LEADSOURCE]= ‘Referral - AC (Other)’, ‘Referral - AC (Other)’, IIf([leadforpicklist]![LEADSOURCE]= “Referral – ARS”, “Referral – ARS”, IIf([leadforpicklist]![LEADSOURCE]= “Referral – Other”, “Referral – Other”, “Other”))))))))

I used single quotes around the values which has parentheses and I still i get the same error, but if i use only one value with single quotes it works, I dont know why it is not working when i use it with other values. Any suggestion?
 


Use [tics] on EVERYTHING.


Skip,
[sub]
[glasses] [red]Be Advised![/red]
A wee deranged psychic may be runnin' around out there!
SMALL MEDUIM @ LARGE[tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top