Datetime help
Posted in 1996
Using SE V4.12 UE3 on HP870 Unix box operating onHPUX V9.04 We are attempting to obtain an interval difference (i.e how log a patient stayed in hosp for ) between 2 events where the events record the date and time 2 seperate fields as below Table : Patmi1af. adate char(6) [yymmdd] admission date atime char(5) [HH:MM] " " time Table : Patdschf. ddate char(6) [yymmdd] discharge date dtime char(5) [HH:MM] " " time generally the Discharge event is after the Admission event. WE tried the statement below but got a Syntax error pointing to the "minus " sign in the last statement ... Checked the manuals but could not see why ?? Any pointers please .. _______________________________________________________________________________ <...other prior select statements sniped....> SELECT t0.*, adate[1,2] || "-" || adate[3,4] || "-" || adate[5,6] || " " || atime[1,5] admda te from t0, patmi1af where adms = daadmno into temp t1; SELECT t1.*, ddate[1,2] || "-" || ddate[3,4] || "-" || ddate[5,6] || " " || dtime[1,5] disda te from t1, patdschf where adms = ddadmno into temp t2; SELECT t2.*, datetime(disdate) year to minute - <------------------* datetime(admdate) year to minute staymins | from t2 | into temp t3; | | Get Syntax error here ---* ______________________ _______________________________| B.Raman |______ \\ Internet: | EDS NZ | / \\ bsqlbp@mash.wnhealth.co.nz | Private Bag 7902. | / )Voice: | Wellington 6001, N.Z | ( / 04-385-5999 |______________________| \\ /_________________________________) (________\\