Re: [SQL] time comparing

From: Remigiusz Sokolowski <rems(at)gdansk(dot)sprint(dot)pl>
To: Patrik Kudo <kudo(at)partitur(dot)se>
Cc: pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] time comparing
Date: 1999-03-09 13:09:00
Message-ID: Pine.GS4.4.02A.9903091404550.5490-100000@netra.gdansk.sprint.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> > hi!
> > I need to compare two values of time.
> > One of them is just value of field - I want to compare it to value of
> > now() less 1 hour - shortly I want to select all records which are older
> > then 1 hour - how to do that?
>
> Ah! This reminds me! I've been wondering about a similar problem. How do
> I
> exchange that 1 hour with one week or one month? Probably the same way
> as
> with one hour (if there is any easy way)...

hi!
I just solve this
there is function age()
I do that this way
age(datetime(my_timestamp_fld),datetime(now())) > 3600::timespan

But I'm still wonder if all function are write for datetime type.
I thought that timestamp is hmmm... some kind of basic internal
representation of time, so search for such function for type timestamp - I
have 6.3.2 ver. May be in newer version there are already functions for
timestamp type?
Rem
-------------------------------------------------------------------*------------
Remigiusz Sokolowski e-mail: rems(at)gdansk(dot)sprint(dot)pl * *
-----------------------------------------------------------------*****----------

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message secret 1999-03-09 18:32:16 How to optimize a query...
Previous Message Patrik Kudo 1999-03-09 12:54:22 Re: [SQL] time comparing