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

Query using the Sys_Calendar to return quarterly results - response (1) by dnoeth

$
0
0

What exactly are you looking for?
There are already quarter_of_year and quarter_of_calendar columns in sys_calendar.
And a calculation of start and edn of quarter as date would be somehing like
 

start: ADD_MONTHS(d - (EXTRACT(DAY FROM d)-1), -((EXTRACT(MONTH FROM d) + 2) MOD 3))

end: ADD_MONTHS(d - (EXTRACT(DAY FROM d)-1), -((EXTRACT(MONTH FROM d) + 2) MOD 3)+3) - 1

 

 

Dieter


Viewing all articles
Browse latest Browse all 27759

Trending Articles



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