[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: Conditional selects
- Subject: Re: Conditional selects
- From: "Wanko, Christopher G, CFCTR" <apollo@ATT.COM>
- Date: Wed, 31 May 2000 08:47:57 -0400
I hate Outlook.
> let $selectedValue = 'valueSelected'
> begin-select
> field1
> field2
> field3
> from tablename
> where field2 is null
> field2 = $selectedValue
> end-select
Try:
if isnull($selectedValue)
let $thiswhere = 'and field2 is NULL'
else
let $thiswhere = 'and field2 = ' || $selectedValue
end-if
Then:
begin-select
field1
field2
field3
from tablethingie
where something equals someThing
[$thiswhere]
and something else equals anotherThing
order by 1,3,2
-Chris