March 12, 2010 at 12:16 am
Hi,
I need your help to develop a query with the date between current month and current month + 11 months.
my table contains below data
tbl1
-------
name dt
xxx 01-Apr-2010
xyz 02-May-2010
abc 01-Mar-2010
I need all 12 months in the same dt column. As of now dt column contains values for mar,apr,may but i need all other months in the same column.
Please help me it is very urgent.
Thanks in advance.
Madhuri
March 12, 2010 at 11:19 pm
Not exactly sure what you are asking, so to help us help you, please read and follow the instructions in the first article i reference below in my signature block. In addition, please provide the expected results based on the sample data.
Doing this will make it easier for us to help you, please the added benefit is that you will get tested code in return.
March 12, 2010 at 11:28 pm
Not sure of what is the requirement. Can u please elborate more with an example?
March 13, 2010 at 3:45 am
Why do you have MAY 2nd in your list instead of May 1st?
What data format is your dt column?
Please help us help you.
March 15, 2010 at 12:10 am
Hi,
Thanks for your suggestions. I am posting the output of the results which needs to come.
my table contains below data
tbl1
-------
name dt
xxx 01-Apr-2010
xyz 02-May-2010
abc 01-Mar-2010
results should come like below
name dt
xxx 01-Apr-2010
xyz 02-May-2010
abc 01-Mar-2010
xxx 01-Jun-2010
xxx 01-Jul-2010
xxx 01-Aug-2010
xxx 01-Sep-2010
xxx 01-oct-2010
xxx 01-Nov-2010
xxx 01-Dec-2010
xxx 01-Jan-2011
xxx 01-Feb-2011
Thanks in advance.
Madhuri
March 15, 2010 at 6:14 am
madhuri-425013 (3/15/2010)
Hi,Thanks for your suggestions. I am posting the output of the results which needs to come.
my table contains below data
tbl1
-------
name dt
xxx 01-Apr-2010
xyz 02-May-2010
abc 01-Mar-2010
results should come like below
name dt
xxx 01-Apr-2010
xyz 02-May-2010
abc 01-Mar-2010
xxx 01-Jun-2010
xxx 01-Jul-2010
xxx 01-Aug-2010
xxx 01-Sep-2010
xxx 01-oct-2010
xxx 01-Nov-2010
xxx 01-Dec-2010
xxx 01-Jan-2011
xxx 01-Feb-2011
Thanks in advance.
Madhuri
I'll second what Lutz asked...
Why do you have MAY 2nd in your list instead of May 1st?
What data format is your dt column?
Please help us help you.
Otherwise, I am posting the article that will teach you how to make "the output of the results which needs to come". 😉
http://www.sqlservercentral.com/articles/T-SQL/62867/
--Jeff Moden
Change is inevitable... Change for the better is not.
March 19, 2010 at 3:46 am
Hi,
Thanks for your valuable suggestion.
Thanks,
Madhuri
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply