Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 26 Mar 2004 @ 10:53:27 GMT


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


Subj:   Re: Date out of date time fields
 
From:   Vishal_Pandya

Hi Manish,

Try the following and see if it suffices your requirement.

-Vishal.

-----------------------------------------------------
 BTEQ -- Enter your DBC/SQL request or BTEQ command:
ct testdatetime(c1 timestamp);
ct testdatetime(c1 timestamp);
 *** Table has been created.
 *** Total elapsed time was 1 second.


 BTEQ -- Enter your DBC/SQL request or BTEQ command:
show table testdatetime;
show table testdatetime;
 *** Text of DDL statement returned.
 *** Total elapsed time was 1 second.

-----------------------------------------------------------------------
CREATE SET TABLE VISHAL.testdatetime ,NO FALLBACK ,
     NO BEFORE JOURNAL,
     NO AFTER JOURNAL,
     CHECKSUM = DEFAULT
     (
      c1 TIMESTAMP(6))
PRIMARY INDEX ( c1 );
 BTEQ -- Enter your DBC/SQL request or BTEQ command:
insert testdatetime('2003-02-02 12:12:12.123');
insert testdatetime('2003-02-02 12:12:12.123');
 *** Insert completed. One row added.
 *** Total elapsed time was 1 second.


 BTEQ -- Enter your DBC/SQL request or BTEQ command:
select * from testdatetime;
select * from testdatetime;
 *** Query completed. One row found. One column returned.
 *** Total elapsed time was 1 second.
                        c1
--------------------------
2003-02-02 12:12:12.123000


 BTEQ -- Enter your DBC/SQL request or BTEQ command:
select cast(c1 as date format 'dd-mm-yyyy') from testdatetime;
select cast(c1 as date format 'dd-mm-yyyy') from testdatetime;
 *** Query completed. One row found. One column returned.
 *** Total elapsed time was 1 second.
        c1
----------
02-02-2003


     
  <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