473,386 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Create column from Row value

Is there a way to create a colum from values in a row?
For example, Let's say I have the following:
12345 Bigfoot 1 $1.00
12345 Bigfoot 2 $2.00
12345 Bigfoot 3 $3.00

Can I turn it into this:

ID NAME 1 2 3
12345 Bigfoot $1.00 $2.00 $3.00
Thanks for all your help guys!

-Tricon
Nov 12 '05 #1
1 6665
tr*******@hotmail.com (Tricon) wrote in message news:<de************************@posting.google.co m>...
Is there a way to create a colum from values in a row?
For example, Let's say I have the following:
12345 Bigfoot 1 $1.00
12345 Bigfoot 2 $2.00
12345 Bigfoot 3 $3.00

Can I turn it into this:

ID NAME 1 2 3
12345 Bigfoot $1.00 $2.00 $3.00


Hi Tricon,

One way is to create a query using the "Cross-tab Query Wizard".

1) Select the ID and Name as "row headings".
2) Select the column containing the values 1,2,3... as the column
heading (I have called this column "Type").
3) The last column left is your dollar column (Which I have called
"Amount"). At the next step, apply the "Sum" function to this column
and it is done.

The underlying SQL for this looks like:

TRANSFORM Sum(tblBigFoot.Amount) AS [The Value]
SELECT tblBigFoot.ID, tblBigFoot.Name, Sum(tblBigFoot.Amount) AS
[Total Of Amount]
FROM tblBigFoot
GROUP BY tblBigFoot.ID, tblBigFoot.Name
PIVOT tblBigFoot.Type;

HTH

Regards
Stuart
Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Guy Deprez | last post by:
Hi, i'm having a problem to create indexes. STEP 1 ----------- Connection is OK (you can find the string at the end of the message) Table ("Couleurs") creation is OK STEP 2. Index Creation
7
by: Wolfgang Kreuzer | last post by:
Hello all, I have two tables - Projects and ProjectStruct Table Projects contains master records of the projects, ProjectStruct allows to define a project herarchie and contains the fields...
6
by: Rudolf Bargholz | last post by:
Hi , I have the following tables ------------- PAX: Id Order_Id Name Position
6
by: Dan V. | last post by:
I would like to create a 2D string list (2D ArrayList ???). I would like to pass in a table or query as a parameter and have both columns transform into a 2D ArrayList. When I sort the one...
1
by: Mortar | last post by:
Hi, I have a datalist which has a column with data from a database. I would like the column to either show a textbox with the value of the data field, or a button. The contol created would...
4
by: Abdhul Saleem | last post by:
Hi, I am recieving error ActiveX component can't create object in the following line in the asp page. set ExcelApp = CreateObject("Excel.Application") Previously this code was working fine....
27
by: max | last post by:
Hello, I am a newbye, and I'm trying to write a simple application. I have five tables with three columns; all tables are identical; I need to change some data in the first table and let VB...
2
by: lakuma | last post by:
Hi, I have a table called A (say) with columns called name, place, animal and thing. I would want to write an on insert trigger on this table, which would create a table with the name of the...
13
by: =?Utf-8?B?UGV0ZXI=?= | last post by:
I want to create a new column in a datatable from two existing columns. I have no problem to create the new column using the datatable.columns.add method. The problem is the value of the new...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.