tags:

views:

43

answers:

2

Original question was unclear, so attempting to simplify and rephrase.

In MS Access I have a Query that is supposed to find all records which:

  1. Have a PhaseID (entered by user) of X, for simplicity take 3.
  2. Only show the records where the priority field is set to greater or equal then 2.

Below is the query shown that is currently in existence that's supposed to achieve the above for all records having PhaseID of 3.

EDIT: the below query is formulated in the Priority field. So I need all Priorities with priority 1 not showing. That's essentially what the below is supposed to do, but it doesn't do anything.

IIf([Forms]![frm_OfferteEnOrderOpvolging]![PhaseID]=3,2,1) OR
IIf([Forms]![frm_OfferteEnOrderOpvolging]![PhaseID]=3,3,1)
A: 

I am not sure I get your point, why not:

 WHERE PhaseID>=[Forms]![frm_OfferteEnOrderOpvolging]![PhaseID]
Remou
I'm actually just trying to get all Priorities with a level equal to and above two showing when PhaseID = 3...
Tony
A: 

Unless I am missing somthing it should just be a case of doing something like this

WHERE (((tblFoo.Phase_ID)=3) AND ((tblFoo.Priority)>=2 And (tblFoo.Priority)<>1))     
OR    (((tblFoo.Priority)>=2 And (tblFoo.Priority)<>1));

But you first question is not very clear so if you could repost I can tweak this SQL to suit

Kevin Ross
What you're saying actually makes sense, however, doing exactly that in MS Access still gives me all records which do have Priority of 1... :(
Tony
That’s not possible, both sides of the OR statement include the condition “tblFoo.Priority <> 1". Is it possible that this field is a text and not a number? That might cause problems with it
Kevin Ross
Currently it seems I have resolved it, I'm not sure where the problem was, but I rebuilt the query from scratch, step by step and now it works as it should! Thanks for the help :)
Tony