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.
Author |
Topic |
abrahamjohn
Starting Member
1 Post |
Posted - 2012-10-27 : 02:37:54
|
Need help in making a queryI have a table as follows - the values are populated automatically to the table.(guidance columns goes upto column12, from which will select values till Month11 columnSnapshot of Tablehttps://docs.google.com/open?id=0B5ABzjFXNq33Mm4wMXpMei05MmsCase1 - If present month is Oct 2012-GuidanceMonth1 corresponds to Nove 2012GuidanceMonth2 corresponds to Dec 2012GuidanceMonth3 corresponds to Jan 2013GuidanceMonth4 corresponds to Feb 2013 etcCase2 - If present month is Jan 2013-GuidanceMonth1 corresponds to Feb 2013GuidanceMonth2 corresponds to Mar 2013GuidanceMonth3 corresponds to Apr 2013GuidanceMonth4 corresponds to May2013 etc-----------------------------------I want to have a logic developed as a query where I can select the final result as follows.if present month is october 2012, jan 2013 , jun 2012 respectively my result table should be like thisCan anyone help?This is required for all months from 1 to 12..irrespective of year it should get dataSnapshot of Tablehttps://docs.google.com/open?id=0B5ABzjFXNq33dEdHQmw1WmNocW8 |
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-10-27 : 08:58:03
|
I am unable to see any difference between your two screen shots other than the column labels being different. Can you describe or post sample data in a form someone can run copy and past? This blog may help you to create DDL's. http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxAlso, instead of making all values = 100, if you can use values that are different so someone can discern how they change from input to output, that would be helpful. |
 |
|
|
|
|