Data from rows to column

iqbalshah

New member
Local time
Today, 20:34
Joined
Apr 6, 2014
Messages
4
I need to change rows data into column.
I have a table name as Temp_Report1 with fields Lab_No, Test Name, Reslt, Test_master

Lab_no
Test Name
Result
Test_Master
4.414
Hemoglobin
00
HAEMATOLOGY
4.414
Red Cells
01
HAEMATOLOGY
4.414
E.S.R
02
HAEMATOLOGY
4.414
Reticulocytes
03
HAEMATOLOGY

etc
etc


The another table where I want to copy data is New_repo2 with fields Lab_no, v1, v2, v3 etc.
Need as
Lab_No
V1
V2
V3
V4
V5…
4.414
Hemoglobin
Red Cells
E.S.R
Reticulocytes
Etc

How to change this from rows to one column, I need query or VB6 code. Thanks
 
You would need to create a crosstab query on the first table and then use that as the source for an append query into the second table.

The question i would ask is why you would want to do this? I would guess you want it to make reading a little easier (in a report maybe)? If so you would not need the second table, just use the crosstab query as the record source for the report.
 
Thanks for your reply, but i dont understand. Do u have any example in MS Access 2003/2007?
 

Users who are viewing this thread

Back
Top Bottom