Link to home
Start Free TrialLog in
Avatar of JC_Lives
JC_LivesFlag for United States of America

asked on

Access 2007 query - "criteria" syntax

Hi,

I have a query that I'd like to display only certain records. Instead of filtering every time my query runs, I'd like to type something like this into the "criteria" box: <> "20" and <> "25"

But this is giving me a syntax error. Any thoughts??

Thanks!!!
Avatar of Steve
Steve
Flag of United States of America image

Try using
 != "20" and != "25"

But unless you stored these numbers as text you shouldn't need the quotes.
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That is not possible. A parameter can hold one value only.

/gustav
JC_Lives,

the comment you accepted will NOT work in the access query builder

Avatar of JC_Lives

ASKER

Well, it worked when i typed Not in(20,25) in the criteria section... but your solution gave me the same error that I had before... I'm kindof confused why your solution doesn't work... maybe I have a mix between numbers and text? I don't know how to check that... :(
the criteria Not in(20,25) was from my post Not the one you accepted.

open the table in design view,
see the Data Type of the field you are filtering
Oh... shoot... for the record everyone, the solution was from capricorn1: criteria Not in (20,25). I'm sorry capricorn1... thanks for your help!!!!
JC_Lives,
click on the Request Attention above to reopen the Q
Cap1,
 Email the mods. They may swap the points.
Thanks guys, requested attn. Will swap if possible.
Thanks Capricorn1!!!!!! Sorry for the delay!!!!!!