Help With Criteria

  • Thread starter Thread starter Xavier
  • Start date Start date
X

Xavier

I'm having a hard time figuring out how to write the criteria to limit
my query results. Basically, I have the following data:

Model Type
ABC 1
ABC 1
DEF 2
DEF 1
GHY 2

What I want to do is NOT display model type 'DEF' unless it is type 2.
How would I go about writing this criteria? Thank you!

Xavier
 
Xavier said:
I'm having a hard time figuring out how to write the criteria to limit
my query results. Basically, I have the following data:

Model Type
ABC 1
ABC 1
DEF 2
DEF 1
GHY 2

What I want to do is NOT display model type 'DEF' unless it is type 2.
How would I go about writing this criteria? Thank you!

Xavier

SELECT * FROM my_table WHERE Model <> "DEF" OR (Model = "DEF" AND Type = 2)

n.b. "Type" is not a good name for a column, since it is a keyword in
various contexts e.g. the DAO "Type" property.
 
Thanks guys, got it working! Oh and my field name isn't titled type.
I was just using that name as an example :-)

Xavier
 
Back
Top