question

sumansidda avatar image
sumansidda asked

Calendar query

Hello every one I am trying to create a query for calendar month in the results window. My output should be like sun mon tue wed thu fri sat 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 and it should be working for every month we execute. can anyone plz suggest me some ideas.
t-sqlcalendar
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Kev Riley avatar image
Kev Riley answered
A quick search found this solution: http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=1173&lngWId=5 by the Exceptional DBA himself, Jeff Moden.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sumansidda avatar image
sumansidda answered
Thank you Thats a really gr8 way to do it. Just was thinking is it possible to do the same thing using a while loop.
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

I know this is an old post but I still have to ask... why do you want to do it using a WHILE loop?
0 Likes 0 ·
Initially I tried it using some loops and got to a certain point where I couldn't get the exact result I wanted. So just was a bit curious to find out if there is a way to do it using while loop. :)
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.