Re: [SQL] CASE Select, referring to selected value

2002-07-02 Thread Nick Riemondi
I finally thought to try this about an hour after posting. Doh! Works perfectly. Thanks! [EMAIL PROTECTED] writes: >On Mon, 1 Jul 2002, Nick Riemondi wrote: > >Just rewrite your case statement in the where clause. > >> Hi! >> I've got 2 date fields in table which constitute a term. On select I

Re: [SQL] CASE Select, referring to selected value

2002-07-02 Thread Christopher Kings-Lynne
> select case when (current_date > available) then ((end_date - > current_date) / 30) > when (current_date < available) then ((end_date - available) / > 30) >end >from listing >where case > 4 > > which yields: > ERROR: parser: parse error at or near ">" > > Doe

Re: [SQL] CASE Select, referring to selected value

2002-07-02 Thread Achilleus Mantzios
On Mon, 1 Jul 2002, Nick Riemondi wrote: Just rewrite your case statement in the where clause. > Hi! > I've got 2 date fields in table which constitute a term. On select I'm > calculating that term, BUT I can't figure out how to refer to it in the > sql - or if it's possible. I'd like to be ab

[SQL] CASE Select, referring to selected value

2002-07-02 Thread Nick Riemondi
Hi! I've got 2 date fields in table which constitute a term. On select I'm calculating that term, BUT I can't figure out how to refer to it in the sql - or if it's possible. I'd like to be able to use the case returned value for order, comparing, etc. Here's an example: select case when (curre