Re: Need help with sql select on null dates!

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Jeff Sacksteder <jwsacksteder(at)ramprecision(dot)com>
Cc: "'pgsql-general(at)postgresql(dot)org'" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Need help with sql select on null dates!
Date: 2002-11-26 14:08:24
Message-ID: 20021126140824.GA31105@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Nov 26, 2002 at 08:47:02 -0500,
Jeff Sacksteder <jwsacksteder(at)ramprecision(dot)com> wrote:
> I'm having trouble doing a select on empty date fields.

Can you be more precise in what you mean by "empty"? Do you mean NULL?

> Suppose my table is composed of employee_number(char), hire_date(date), and
> termination_date(date).
> I would expect to be able to say:
>
> 'select * from employee_tables where termination_date = null'
> or:
> 'select * from employee_tables where isfinite(termination_date) <>
> 1'
>
> ...but no luck. What is the proper way to select undefined dates?

Neither of the about will return rows with termination_date null in recent
versions of postgres. If the value you are trying to match is null, then
using "is null" instead of "= null".

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Doug McNaught 2002-11-26 14:09:11 Re: process time of update
Previous Message Diogo Biazus 2002-11-26 14:01:45 Re: Need help with sql select on null dates!