day difference
day difference
От:
"Jackie Siu" <spjackie@polyu.edu.hk>
Дата:
Hi,
Is there exist a function to calculate day difference between two date. For
example: select functionx('1JAN2001','5FEB2001') from abc where .... Then it
returns 36 (days). Thanks for your help.
Jackie
Re: day difference
От:
"Josh Berkus" <josh@agliodbs.com>
Дата:
Jackie,
> Is there exist a function to calculate day difference between two
> date. For
> example: select functionx('1JAN2001','5FEB2001') from abc where ....
> Then it
> returns 36 (days). Thanks for your help.
>
See the thread entitled "DateDiff" earlier this week, or search the
archives.
-Josh
______AGLIO DATABASE SOLUTIONS___________________________ Josh Berkus Complete information technology josh@agliodbs.com and data management solutions (415) 565-7293 for law firms, small businesses fax 621-2533 and non-profit organizations. San Francisco
Re: day difference
От:
Christopher Sawtell <csawtell@xtra.co.nz>
Дата:
Jackie Siu wrote:
>
> Hi,
>
> Is there exist a function to calculate day difference between two date. For
> example: select functionx('1JAN2001','5FEB2001') from abc where .... Then it
> returns 36 (days). Thanks for your help.
chris=# select ('5feb2001'::date - '1jan2001'::date) as "Days
Difference";Days Difference
----------------- 35
(1 row)
chris=# select version(); version
---------------------------------------------------------------PostgreSQL 7.1.1 on i586-pc-linux-gnu, compiled by GCC 2.95.3
(1 row)
--
Sincerely etc.,
NAME Christopher SawtellCELL PHONE 021 257 4451ICQ UIN 45863470EMAIL csawtell @ xtra . co . nzCNOTES
ftp://ftp.funet.fi/pub/languages/C/tutorials/sawtell_C.tar.gz
-->> Please refrain from using HTML or WORD attachments in e-mails to
me <<--