Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Thu, 11 Dec 2003 @ 17:56:31 GMT

  <Prev Next>   <<First <Prev

Subj:   Re: Concatenating Dates with Times
From:   Smith, Steven L


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

  <Prev Next>   <<First <Prev
  Top Home Privacy Feedback  
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 23 Jun 2019