From: Victor Yegorov <viy@pirmabanka.lv>
To: Rudi Starcevic <rudi@oasis.net.au>
Cc: pgsql-sql@postgresql.org
Subject: Re: CASE
Date: Tue, 8 Apr 2003 12:40:39 +0300
Message-ID: <20030408094039.GS1712@pirmabanka.lv> (raw)
In-Reply-To: <3E928853.7090801@oasis.net.au>
References: <3E928853.7090801@oasis.net.au>
* 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: viy@pirmabanka.lv, rudi@oasis.net.au
Subject: Re: CASE
In-Reply-To: <20030408094039.GS1712@pirmabanka.lv>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox