Re: < and > for datetime - Mailing list pgsql-general

From Martin Schulze
Subject Re: < and > for datetime
Date
Msg-id 20000121001546.F24508@finlandia.infodrom.north.de
Whole thread Raw
In response to < and > for datetime  (Sarah Officer <officers@aries.tucson.saic.com>)
List pgsql-general
Sarah Officer wrote:
> Hi all,
>
> I'm trying to find  less than and greater than functions for
> datetime types.  It doesn't look the the time interval operators
> would be appropriate, but I haven't found anything else in the
> docs.  Here's my snippet of plpgsql which fails:
>
>     select count(*) into rescount
>     from currentresults cr, masters m
>     where cr.ben = new.ben
>     and m.mi_id = cr.mi_id
>     and m.idate > mydate;
>
> rescount & mydate are variables.  How do I compare dates?  I'd be
> glad to read the documentation if I could find the right page.

\do shows:

<= |datetime  |datetime  |bool     |less-than-or-equal
<> |datetime  |datetime  |bool     |not equal
=  |datetime  |datetime  |bool     |equal
>  |datetime  |datetime  |bool     |greater-than
<  |datetime  |datetime  |bool     |less-than

Thus, your WHERE-clause should be proper.

Regards,

    Joey

--
This is Linux Country.  On a quiet night, you can hear Windows reboot.

pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [GENERAL] Unsigned Datatypes
Next
From: Sarah Officer
Date:
Subject: Re: < and > for datetime