Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 generating date for Tuesday in every week

Author  Topic 

xtradi
Starting Member

7 Posts

Posted - 2009-05-13 : 00:37:15
I want to generate a list of date.
The list of date i want is the date for Tuesday for every week in one year.

can somebody help me?

thanks

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-05-13 : 00:41:25
make use of F_TABLE_DATE
here http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=61519&SearchTerms=F_TABLE_DATE


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

xtradi
Starting Member

7 Posts

Posted - 2009-05-13 : 00:53:13
is my code correct for displaying Tuesday in year 2009?

select *
from
dbo.F_TABLE_DATE ( '20090101','20091231' )

where day_of_week=3

Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-05-13 : 00:59:59
quote:
Originally posted by xtradi

is my code is correct for displaying Tuesday in year 2009?

select *
from
dbo.F_TABLE_DATE ( '20090101','20091231' )

where day_of_week=3





yes.
Or you can also check for

WHERE weekday_name = 'Tue'


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

xtradi
Starting Member

7 Posts

Posted - 2009-05-13 : 01:01:05
Thanks a lot khtan!
Go to Top of Page
   

- Advertisement -