x
login about faq Site discussion (meta-askssc)

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.

more ▼

asked Jul 27 '12 at 03:52 PM in Default

sumansidda gravatar image

sumansidda
0 1 1

(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first

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.

more ▼

answered Jul 27 '12 at 07:53 PM

Kev Riley gravatar image

Kev Riley ♦♦
46.1k 39 43 69

(comments are locked)
10|1200 characters needed characters left

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.

more ▼

answered Aug 03 '12 at 02:58 PM

sumansidda gravatar image

sumansidda
0 1 1

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x914
x6

asked: Jul 27 '12 at 03:52 PM

Seen: 426 times

Last Updated: Aug 03 '12 at 02:58 PM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.