how to extract only mondays in 2007
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


how to extract only mondays in 2007 Expand / Collapse
Author
Message
Posted 3/1/2007 5:03:34 PM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 4/22/2007 2:58:00 PM
Posts: 18, Visits: 1
Needs extract only mondays in 2007.

how can i achevie using Teradata SQL

Thanks
Chinna
Post #6757
Posted 3/2/2007 1:05:28 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 6/25/2008 12:53:07 PM
Posts: 118, Visits: 60
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.



Regards
Ramakrishna_Vedantam
Post #6766
Posted 3/9/2007 2:54:02 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 7/11/2008 10:57:48 AM
Posts: 7, Visits: 9
try:
select calendar_date
from sys_calendar.calendar
where day_of_week=2
and year_of_calendar = 2007
order by 1;
Post #6834
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 ( 0 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 10:50pm

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.031. 9 queries. Compression Disabled.