Re: Datetime help
Posted in 1996
Bhupendra, The problem is not with the minus, it's most likely with what your datetime value looks like. The error (syntax) is referring to the way your datetime looks. You might try just selecting the values by themselves to verify you have the proper format. For example, if you have 2 spaces instead of one between the date and the time, Informix will give you a syntax error. By the by, for some examples, refer to the Informix Guide to SQL: Reference Manual, 7.1, page 3-32. Troy Bhupendra Patel <bsqlbp@wnhealth.co.nz> wrote in article <5807bq$p2b@cssun.mathcs.emory.edu>... > Using SE V4.12 UE3 on HP870 Unix box operating onHPUX V9.04 > > ... > 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; |