Re: CASE - Mailing list pgsql-sql

From Victor Yegorov
Subject Re: CASE
Date
Msg-id 20030408094039.GS1712@pirmabanka.lv
Whole thread Raw
In response to CASE  (Rudi Starcevic <rudi@oasis.net.au>)
Responses Re: CASE
Re: CASE
List pgsql-sql
* Rudi Starcevic <rudi@oasis.net.au> [08.04.2003 11:37]:
> CASE
>    WHEN COALESCE( MAX(e.edate),'2003-01-01') >= now()::date THEN 'events'
>    ELSE 'noevents'
> END as myevents,

I'm not sure completely, but first thing i saw in your query, is:

...COALESCE( MAX(e.edate),'2003-01-01')...

MAX(e.edate): will return date type (just a guess)
'2003-01-01': will return char type (or varchar, doesn't matter).

Try to cast string into date.

--

Victor Yegorov

pgsql-sql by date:

Previous
From: Rudi Starcevic
Date:
Subject: CASE
Next
From: "Yudha Setiawan"
Date:
Subject: Language SQL, But Need Return PlPgSql