Hi all
I have a SELECT statement which needs to have a WHERE clause adapt if a
variable has a value or not:
WHERE CASE WHEN 72 <> 0 THEN tDevelopment.iID = 72
ELSE (CAST(tDevelopment.tDT AS DATE) BETWEEN (SELECT US1.dValue
FROM dSetValue('Current Year', 'From') US1)
AND (
Bhavbhuti,
> I have a SELECT statement which needs to have a WHERE clause adapt if a
> variable has a value or not:
>
> WHERE CASE WHEN 72 <> 0 THEN tDevelopment.iID = 72
> ELSE (CAST(tDevelopment.tDT AS DATE) BETWEEN (SELECT US1.dValue
> FROM dSetValue('Current Year', 'From') US1
ent: 23. februar 2015 06:25
To: firebird-support@yahoogroups.com
Subject: [firebird-support] Multiple WHERE clauses
Hi all
I have a SELECT statement which needs to have a WHERE clause adapt if a
variable has a value or not:
WHERE CASE WHEN 72 <> 0 THEN tDevelopment.iID = 72
Sean:
Which is the difference between it:
WHERE 1 =
CASE
WHEN (Param <> 0) THEN 1
WHEN (Some OtherTest) THEN 1
WHEN (Yet another Test) THEN 1
ELSE 0
END
and it:
Param <> 0 OR SomeOtherTest OR YetAnotherTest
?
Because I get the same result with both ways.
Greetings.
Walter.
On Wed, Feb 25,