how to extract only mondays in 2007

UDA

how to extract only mondays in 2007

Needs extract only mondays in 2007.

how can i achevie using Teradata SQL

Thanks
Chinna
4 REPLIES

Re: how to extract only mondays in 2007

Chinna,

Your question is very vague.
Do you have a table which has a date column and do you want to extract Mondays from those values
or
in general from calendar view?

Yet I guess this select will help you achieve if you change it according to your needs.

The following SQL extracts all Mondays in the date range mentioned in the where clause.

select * from sys_calendar.calendar where day_of_week=2 and calendar_date between date -77 and date
order by 1;

Also check this URL when you have time.
http://www.teradataforum.com/attachments/a040409b.doc

Hope this serves your question.

N/A

Re: how to extract only mondays in 2007

Do you think multi-posting is the best way to get an answer ?

Re: how to extract only mondays in 2007

Good point raised by al1_24. The categorization into topics makes no meaning then. In fact I should also apologize for having posted the answers to the questions everywhere. Well, different approaches are taken by different people when they are contrained by time to get a solution.

N/A

Re: how to extract only mondays in 2007

You may want to use Year_Of_Calendar instead of the BETWEEN clause.

SELECT Calendar_Date
FROM SYS_Calendar.Calendar
WHERE Day_Of_Week = 2
AND Year_Of_Calendar = 2007
ORDER BY 1;

Vinay