Subject | Re: [firebird-support] Conditional/alternative where clauses |
---|---|
Author | Serdar Gül |
Post date | 2011-03-23T08:05:57Z |
did you try to use or clause
for example
select <Field1, Field2, Filed3>
from Table1
where ( (field1 = 6) and (Field2 between '3/1/2011' and '3/31/2011') )
else
where ( (field1 <> 6) and ( Field2 between '3-1-2012' and '3-22-2012') )
2011/3/23 homerjones1941 <homer@...>
for example
select <Field1, Field2, Filed3>
from Table1
where ( (field1 = 6) and (Field2 between '3/1/2011' and '3/31/2011') )
else
where ( (field1 <> 6) and ( Field2 between '3-1-2012' and '3-22-2012') )
2011/3/23 homerjones1941 <homer@...>
>[Non-text portions of this message have been removed]
>
> Is there a way to do something like this:
>
> select <Field1, Field2, Filed3>
> from Table1
> if (field1 = 6) then
> where (Field2 between '3/1/2011' and '3/31/2011')
> else
> where field2 between '3-1-2012' and '3-22-2012')
>
> I've tried this, and other variations (including When and Case), but no
> luck. I was hoping to do this to create a view.
>
>
>