Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Sergey Oleshko — — source: Informix-list mailing list archive (1991-1998)
I don't understand why are you using CHAR(8) to store time data.
The DATETIME is preferred fot this purpose.
Check the time column format first - if it follows
"HH:MM:SS" rule, the conversion is done implicitly:
define t datetime year to second
define s char(8)
let s = "10:30:15"
let t = s
There is no explicit way to convert values with other column formats.
Next, you cannot add two date or datetime values. However, you can subtract
them to get INTERVAL value and add it to another datetime variable.
define d date
define t datetime hour to second
define t0 datetime hour to second
define i1 interval hour to second
define i2 interval year to second
define r datetime year to second
define s char(8)
let d = today -- date (year to day)
let t = current -- time (hour to second)
let s = "00:00:00" -- midnight (char)
let t0 = s -- midnight (time)
let i1 = t - t0 -- time since midnight
let i2 = i1 -- expand interval
let r = d + i2 -- result desired
darredge (darredge@bigpond.com) wrote:
: having trouble using datetime in 4GL ( 6.04.UC1 )
:
: i am using a cursor to select a date column, and a time column (char(8))
: into variables and then want to combine these two variables into a single
: datetime.
:
: how ?
:
: it doesnt seem to handle the time column, is there a trick to converting a
: CHAR to a DATETIME
:
: i keep getting error -1262 Non-numeric character in dtetime or interval
:
: thanks
: Darren Edgerton
:
:
:
:
--
S.Oleshko
International Data Systems
sol@ids.lviv.ua
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.