Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 03 Nov 2011 @ 15:49:11 GMT


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


Subj:   Re: Alternative for dayofweek function
 
From:   DAUGHERITY, RALPH C

Besides using Sys_Calendar.CALENDAR , there are several ways to calculate DayOfWeek. Here is one:

     , CASE (mydate - DATE '1900-01-01') MOD 7
            WHEN 0 THEN 'Mon'
            WHEN 1 THEN 'Tue'
            WHEN 2 THEN 'Wed'
            WHEN 3 THEN 'Thu'
            WHEN 4 THEN 'Fri'
            WHEN 5 THEN 'Sat'
            WHEN 6 THEN 'Sun'
            ELSE 'err'
       END   AS DOW

Ralph Daugherity



     
  <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