[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Conditional selects



Title: RE: Conditional selects

Just thought Id echo your sentiments on outlook.  I wonder is it a worldwide hatred? Im in Ireland.

-----Original Message-----
From: Wanko, Christopher G, CFCTR [mailto:apollo@ATT.COM]
Sent: Wednesday, May 31, 2000 1:48 PM
To: SQR-USERS@LIST.IEX.NET
Subject: Re: Conditional selects


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