How to capture first 4 days from all the month using teradata

Database

How to capture first 4 days from all the month using teradata

HI team ,

I want to pull first 4 days from all the months.

For ex Below calender date is 18th july , so it should display JULY 1 to 4th in rows

Calender_Date =TO_DATE ('07/18/2010', 'MM/DD/YYYY')

I am using below command to get first day of month .

Calender_Date - extract(day from Calender_Date ) +1 ,Calender_Date   From table

 

i am expecting output in rows as :

 

7/1/2010

7/2/2010

7/3/2010

7/4/2010

Please help me

1 REPLY
Enthusiast

Re: How to capture first 4 days from all the month using teradata

Query the sys_calendar.calendar view.... where day_of_month < 5....and other residual conditions as necessary.