date_arithmetic revisited - Mailing list pgsql-sql

From Thomas Good
Subject date_arithmetic revisited
Date
Msg-id Pine.LNX.3.96.990730101114.4153A-100000@admin.nrnet.org
Whole thread Raw
Responses Re: [SQL] date_arithmetic revisited
List pgsql-sql
Herouth,

I am doing this:

psql tracker -qtc "select date_part('epoch', '$edate'::datetime);" > .arg1
psql tracker -qtc "select date_part('epoch', '$sdate'::datetime);" > .arg2
date1=`cat .arg1`;
date2=`cat .arg2`;
psql tracker -qtc "select ($date1 - $date2) / 60 / 60 / 24;"
to calculate intervals...this is census stuff.
How many Pt Days per bed, etc.

Is there a way/function that allows me to do simple date arithmetic,
ala, `SELECT $enddate - startdate;' ?

Cheers and thanks,
Tom


------- North Richmond Community Mental Health Center -------

Thomas Good                                   MIS Coordinator
Vital Signs:                  tomg@ { admin | q8 } .nrnet.org                                         Phone:
718-354-5528                                          Fax:   718-354-5056                               
 
/* Member: Computer Professionals For Social Responsibility */ 



pgsql-sql by date:

Previous
From: "Carlos"
Date:
Subject: unsuscribe
Next
From: Tom Lane
Date:
Subject: MVCC and concurrent clients