December 1, 2008 at 11:34 pm
hi all,
I need to create table using another table.this table colums are must be same as row of the second table.
like as follows.
second table
--------------+-------------------+----------------+
Item Name + Quantity + Rate +
--------------+-------------------+----------------+
Cement + 100 + 750.00 +
Stone + 50 + 1500.00 +
Tile + 1000 + 2500.00 +
Cables + 500 + 250.00 +
Water Pumps + 10 + 15000.00 +
--------------+-------------------+----------------+
I need to create table using before table like this
-------------+-------------+-------------+-------------+--------------+-------------+
Item Name + Cement + Stone + Tile + Cables + Water Pumps +
-------------+-------------+-------------+-------------+--------------+------------- +
Quantity + 100 + 50 + 1000 + 500 + 10 +
-------------+-------------+-------------+-------------+--------------+--------------+
Rate + 750.00 + 1500.00 + 2500.00 + 250.00 + 15000.00 +
-------------+-------------+-------------+--------------+--------------+-------------+
please tell me any one knew this.
thanks.
December 2, 2008 at 7:05 am
I'm not sure what you are asking. Do you want to take the data from the first table and create a table from the data? Does this need to be a permanent table or are you just looking to Pivot the data for viewing so that the Item Name is the column header? If you just need to pivot for reporting purposes check out this article: Cross Tabs and Pivots, Part 1 – Converting Rows to Columns[/url]
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
December 2, 2008 at 7:14 am
Failing to plan is Planning to fail
December 3, 2008 at 8:27 am
And of course, Jeff's newest article on Dynamic Cross Tabs: http://www.sqlservercentral.com/articles/cross+tab/65048/
December 3, 2008 at 11:56 pm
thank Jack Corbett ur help,thanks a lot
October 28, 2009 at 12:31 am
I created 2 tables
1 st table as csat
csat_code csat_ou_cod csat_csaeid cus name
CSA00001 ADM00001 6825 CUS08349
CSA00002 ADM00001 6826 CUS08347
CSA00003 ADM00001 6832 CUS08351
CSA02547 ADM00001 6824 CUS04150
table2 as csat_survey
surveycode csat_code qns id ans id
SUR00001 CSA02547 1 3
SUR00002 CSA02547 4 7
now i want the resut is
csat_code csat_case_id qns id(column name)
like the row field of qns id ( table2) is cloumn for my solution table. and the number of qns also varied .so i have to create the dynamic header.. plz any one help me? how can i get this solution?
Thanks in advance
Sangita.
October 28, 2009 at 5:15 am
Did you read the articles suggested earlier in the thread?
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply