IS NULL

From: David Link <dlink(at)soundscan(dot)com>
To: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: IS NULL
Date: 2001-11-06 18:52:05
Message-ID: 3BE83155.CDA2A866@soundscan.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

How to check a column value for IS NULL?

I would like to format a string as a date iff it is not null:

This frag returns a bogus date when column value is null:

to_char(to_date (theatre_reldate, 'DDMMYYYY'), 'DD Mon YYYY')

So I'm looking for something of this sort:

(case when not is null (t.theatre_reldate) then
to_char(to_date (theatre_reldate, 'DDMMYYYY'), 'DD Mon YYYY')
end) as theatre_reldate

thanks, david

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Juan Jose Natera Abreu 2001-11-06 19:38:57 Workaround or user defined type
Previous Message Seth Milder 2001-11-06 15:27:13 Rules