Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 27759

Can Teradata display the Quarter value of a date? - response (3) by CarlosAL

$
0
0

Mark:
You can calculate the quarter from dates as ((CAST(EXTRACT(MONTH FROM fecha) AS BYTEINT)-1)/4)+1
 
 BTEQ -- Enter your SQL request or BTEQ command:
SELECT DATE, ((CAST(EXTRACT(MONTH FROM DATE) AS BYTEINT)-1)/4)+1 QUARTER;

 *** Query completed. One row found. 2 columns returned.
 *** Total elapsed time was 1 second.

Current Date      QUARTER
------------  -----------
  2013-05-10            2
HTH.
Cheers.
Carlos.


Viewing all articles
Browse latest Browse all 27759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>