Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 10 Nov 2003 @ 18:50:32 GMT


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


Subj:   Re: Format of Date
 
From:   Michael Larkins

Hi Craig:

You are on the right track, just didn't go far enough. Try this:

SELECT CAST( (date (FORMAT 'MMDDYYYY')) AS CHAR(8)), date FROM branch;

Just wondering, what is branch? People familiar with Oracle know that they need a FROM and it provides a pseudo table called dual. From the output you showed, it would appear that branch is a table with one row in it. Since date is a reserved word in Teradata, the FROM is not needed. You can also write a query to return a single output with today's date as:

SELECT CAST( (date (FORMAT 'MMDDYYYY')) AS CHAR(8)), date;  /* explicit CAST  */

and

SELECT (date (FORMAT 'MMDDYYYY'))(CHAR(8)), date;    /* implicit CAST  */

Hope this helps,

Michael Larkins
Certified Teradata Master



     
  <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