Subject | Re: [firebird-support] Select statement |
---|---|
Author | Mark Rotteveel |
Post date | 2012-10-17T12:04:47Z |
On Wed, 17 Oct 2012 13:47:54 +0200, Nols Smit <nols@...>
wrote:
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
wrote:
> Hi,ID,
>
> I have a table, let's call it TENDERS. It has the following fields:
> Date_Closing, Value (ID is the pimary key).Date_Closing
>
> 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
> is not null and Date_Closing is between DateA and DateB and Value isnull ?
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