On Wed, 17 Oct 2012 13:47:54 +0200, Nols Smit <[email protected]> wrote: > Hi, > > I have a table, let's call it TENDERS. It has the following fields: ID, > Date_Closing, Value (ID is the pimary key). > > How do I select the the records in TENDERS where either Date_Closing or > Value or both is null but also including those records where Date_Closing > is not null and Date_Closing is between DateA and DateB and Value is null ?
I am not sure what problem you are having, but the conditions you describe are a contradiction. Date_Closing or Value or both is null: Date_Closing IS NULL OR Value IS NULL Date_Closing is not null and Date_Closing is between DateA and DateB and Value is null: Value IS NULL AND Date_Closing BETWEEN DateA AND DateB If you combine these two: Date_Closing IS NULL OR Value IS NULL OR Value IS NULL AND Date_Closing BETWEEN DateA AND DateB the result is effectively: Date_Closing IS NULL OR Value IS NULL So I assume you actually need a different condition than the one you are specifying in your question. Mark
