date_arithmetic revisited
От | Thomas Good |
---|---|
Тема | date_arithmetic revisited |
Дата | |
Msg-id | Pine.LNX.3.96.990730101114.4153A-100000@admin.nrnet.org обсуждение исходный текст |
Ответы |
Re: [SQL] date_arithmetic revisited
|
Список | 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 по дате отправления: