Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 24 Aug 2001 @ 12:05:49 GMT


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


Subj:   Re: Using Time(0)
 
From:   Ulrich Arndt

Hi Michael,

The following should work:

create volatile table a
(
 date_value date format 'YYYYMMDD',
 time_value time(0)
)
on commit preserve rows;

insert into a values
(
date,current_time(0)
);

select time_value, date_value,
cast (date_value as timestamp(0))
        + extract(hour from time_value) * Interval '1' hour
        + extract(minute from time_value) * Interval '1' minute
        + extract(second from time_value)* Interval '1' second
from a
;

Using the table above,

select max(cast(time_value as char(14)) !! cast(date_value as char(14)))
from a

also works. What is the exact definition of the date and time fields in the DDL?


Hope that helps

Ulrich



     
  <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: 27 Dec 2016