|
|
Archives of the TeradataForum
Message Posted: Thu, 11 Dec 2003 @ 17:56:31 GMT
Subj: | | Re: Concatenating Dates with Times |
|
From: | | Smith, Steven L |
Dave:
I use this method. Still needs '||', but works well enough.
/*Use this method to CAST separate TIME and DATE fields into one timestamp -
Note that format for the date must be yyyy-dd-mm*/
SEL CAST(((MIN(datefld)(format 'yyyy-mm-dd'))||' '||MIN(timefld))as
timestamp(2))as stime
, CAST(((MAX(datefld)(format 'yyyy-mm-dd'))||' '||MAX(timefld))as
timestamp(2))as etime
from dbc.eventlog, (sel MAX(DateFld)as dt from dbc.eventlog)as a
WHERE dt=datefld
GROUP BY datefld, dt
;
Steven L. Smith
| |