Re: Date-Time Separators
Posted in 1994
nnob@seq1.loc.gov (Nick Nobbe) writes: > Just can't seem to get date-time fields to use / as my separator. > Tried single quotes, tried backslashing to remove the magic, date- > time understands one thing, the dash separator, whether or not the > DATETIME env variable is set. You're right that DATETIMEs are far more restrictive in display; I think all you get is yyyy-mm-dd hh:mm:ss.fffff. As an alternative in 4GL you could display them in two fields, a DATE and a CHAR(8): DEFINE l_datetime LIKE table.datetime DEFINE dte DATE DEFINE tme CHAR(8) DEFINE dtm CHAR(19) SELECT datetime INTO l_datetime FROM table ... LET dte = EXTEND(l_datetime, YEAR TO DAY) LET dtm = l_datetime LET tme = dtm[12,19] DISPLAY ... Gathering INPUT from the two fields for updating the database table will work as well: LET dtm = dte USING "yyyy-mm-dd ", dtm CLIPPED LET l_datetime = dtm And so on. ============================================================ Dennis J. Pimple Informix Software Inc Senior Consultant Denver Colorado USA dennisp@informix.com Voice:303-850-0210 Fax:303-779-4025