pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Pham, Thinh <tpham@mail.priority.net>
To: 'pgsql-sql@postgreSQL.org' <pgsql-sql@postgreSQL.org>
Subject: RE: [SQL] datediff function
Date: Tue, 17 Aug 1999 09:37:04 -0500
Message-ID: <551413BBBB03D111BF880060B01AACCE139F35@home.priority.net> (raw)

Thank you for answering all my stupid questions. I did read the User manual
as well as Programmer and Admin, and what i was able to get out was not
much. I guess i wasn't used to the way that postgres work coming from a
microsoft background. But wouldn't you agree that the manuals was a little
brief and criptic at times? My question is how do i go about writing some
more documentations and examples and submit it for inclusion into the
manual. It just so that the next person w/ the same background as i would be
able to understand those functions quickly and be able to use the example
and apply it to his program w/o asking all those same basic questions which
i'm sure you guys are tired of answering.

Also, is it the same thing for submitting documentation as well as function
into postgres? What i really need was the total amount of time between 2
separate point of times. If i ask for 'day' then it return day, 'minute'
then it return minutes. For example:

Timein				Timeout
Tue Aug 17 15:00:00 1999 CDT	Tue Aug 17 16:00:00 1999 CDT

select datediff(day, timein, timeout) as totaltime from schedule

Would give me a _number_ 0 since it's the same day, and if i used minute as
below:


select datediff(minute, timein, timeout) as totaltime from schedule

It would give me the number 60, that's it. I don't want any qualifier behind
the number since it blew up the stupid microsoft ADO driver like you
wouldn't believe.

Thank you,
Thinh


> -----Original Message-----
> From: Herouth Maoz [mailto:herouth@oumail.openu.ac.il]
> Sent: Tuesday, August 17, 1999 8:29 AM
> To: Pham, Thinh; 'pgsql-sql@postgreSQL.org'
> Subject: RE: [SQL] datediff function
> 
> 
> At 16:18 +0300 on 17/08/1999, Pham, Thinh wrote:
> 
> 
> > What happen if i just want to compare using minute only or 
> hour only instead
> > of day? Is there a function to do that or is postgres only 
> work in day?
> 
> No problem, just write 'now'::datetime - '6 hours'::timespan. 
> Or some such.
> Please read about the datetime and timespan types in the user guide.
> 
> Herouth
> 
> --
> Herouth Maoz, Internet developer.
> Open University of Israel - Telem project
> http://telem.openu.ac.il/~herutma
> 
> 
> 



view thread (12+ messages)  latest in thread

Message-ID: <551413BBBB03D111BF880060B01AACCE139F35@home.priority.net>
Permalink:  ../551413BBBB03D111BF880060B01AACCE139F35@home.priority.net/
Also on:    postgresql.org/message-id/551413BBBB03D111BF880060B01AACCE139F35@home.priority.net

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tpham@mail.priority.net
  Subject: RE: [SQL] datediff function
  In-Reply-To: <551413BBBB03D111BF880060B01AACCE139F35@home.priority.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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