pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
time comparing
3+ messages / 2 participants
[nested] [flat]

* time comparing
@ 1999-03-09 12:48 Remigiusz Sokolowski <rems@gdansk.sprint.pl>
  1999-03-09 12:54 ` Re: [SQL] time comparing Patrik Kudo <kudo@partitur.se>
  0 siblings, 1 reply; 3+ messages in thread

From: Remigiusz Sokolowski @ 1999-03-09 12:48 UTC (permalink / raw)
  To: 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?
	TIA
	Rem

-------------------------------------------------------------------*------------
Remigiusz Sokolowski      e-mail: rems@gdansk.sprint.pl           * *		
-----------------------------------------------------------------*****----------




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: [SQL] time comparing
  1999-03-09 12:48 time comparing Remigiusz Sokolowski <rems@gdansk.sprint.pl>
@ 1999-03-09 12:54 ` Patrik Kudo <kudo@partitur.se>
  1999-03-09 13:09   ` Re: [SQL] time comparing Remigiusz Sokolowski <rems@gdansk.sprint.pl>
  0 siblings, 1 reply; 3+ messages in thread

From: Patrik Kudo @ 1999-03-09 12:54 UTC (permalink / raw)
  To: Remigiusz Sokolowski <rems@gdansk.sprint.pl>; +Cc: pgsql-sql

Remigiusz Sokolowski wrote:
> 
> 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)...

Regards,
Patrik Kudo



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: [SQL] time comparing
  1999-03-09 12:48 time comparing Remigiusz Sokolowski <rems@gdansk.sprint.pl>
  1999-03-09 12:54 ` Re: [SQL] time comparing Patrik Kudo <kudo@partitur.se>
@ 1999-03-09 13:09   ` Remigiusz Sokolowski <rems@gdansk.sprint.pl>
  0 siblings, 0 replies; 3+ messages in thread

From: Remigiusz Sokolowski @ 1999-03-09 13:09 UTC (permalink / raw)
  To: Patrik Kudo <kudo@partitur.se>; +Cc: 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@gdansk.sprint.pl           * *		
-----------------------------------------------------------------*****----------




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~1999-03-09 13:09 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-03-09 12:48 time comparing Remigiusz Sokolowski <rems@gdansk.sprint.pl>
1999-03-09 12:54 ` Patrik Kudo <kudo@partitur.se>
1999-03-09 13:09   ` Remigiusz Sokolowski <rems@gdansk.sprint.pl>

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