Home Page for the TeradataForum
 

Archives of the TeradataForum

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


     
  <Prev Next>   <<First <Prev
Next>
Last>>
 


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



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