Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 22 May 2003 @ 15:08:11 GMT


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


Subj:   Re: Extract day of week from date
 
From:   Updyke, Nathan

select case when (date - date '1900-01-01') mod 7 = 0 then 'Monday'
            when (date - date '1900-01-01') mod 7 = 1 then 'Tuesday'
            when (date - date '1900-01-01') mod 7 = 2 then 'Wednesday'
            when (date - date '1900-01-01') mod 7 = 3 then 'Thursday'
            when (date - date '1900-01-01') mod 7 = 4 then 'Friday'
            when (date - date '1900-01-01') mod 7 = 5 then 'Saturday'
            when (date - date '1900-01-01') mod 7 = 6 then 'Sunday'
            end as DAY_OF_WEEK;


     
  <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