January 3, 2011 at 9:51 pm
Hi
Good morning,
I want to calculate how many thursday occures between 2011-01-04 to 2011-01-20.
Is there any specific functions in SQL 2008? else tell me how can we find?
Thanks in advance
Regards,
Dhamu
January 3, 2011 at 10:10 pm
Hi..
Pls try this link
Also
http://www.sqlservercentral.com/Forums/FindPost961135.aspx
Please reply , if these links helped you.
January 3, 2011 at 10:27 pm
consider my start date is 01/01/2011 and my end date is 20/01/2011. I want to calculate how tuesday occured between those period
January 3, 2011 at 11:55 pm
Try this
declare @t table (id int identity(1,1),time_stamp date)
declare @st date,@en date
select @st = '2011-01-01'
select @en = '2011-01-20'
insert into @t
select convert(varchar(10),@st,110) from INFORMATION_SCHEMA.COLUMNS
update @t set time_stamp = dateadd(day,id-4,time_stamp)
select time_stamp from @t where time_stamp between @st and @en
and datename(weekday,time_stamp) = 'Tuesday'
Regards
Siva Kumar J
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply