473,405 Members | 2,287 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,405 software developers and data experts.

SQL 2000 - How to show the column records as seperate Columns

Hi,

I am new in the field and might be asking a dumb question, but please
I still need help.
I am running the Business Object 5.1.8, and using Freehand SQL with
Oracle 8.1 connecting.

I have four columns e;g

Patient_Name Account_No Birthdate Result Result
Value
Test One 123 1950
Pain 2
Test One 123 1950
Anxiety 5
Test TWO 234 1980 Nausea
1
TEST Three 456 1970 Anxiety
3
TEST Three 456 1970
Pain 4

I would like to have the results in the follow order:

Patient_Name Account_No Birthdate Pain Anxiety
Nausea
Test One 123 1950
2 5
Test TWO 234
1980 1
TEST Three 456 1970
4 3

Is there anybody who can help me.

Mar 29 '07 #1
2 1621
On Mar 29, 10:06 am, "NewBee" <cuta...@gmail.comwrote:
Hi,

I am new in the field and might be asking a dumb question, but please
I still need help.
I am running the Business Object 5.1.8, and using Freehand SQL with
Oracle 8.1 connecting.

I have four columns e;g

Patient_Name Account_No Birthdate Result Result
Value
Test One 123 1950
Pain 2
Test One 123 1950
Anxiety 5
Test TWO 234 1980 Nausea
1
TEST Three 456 1970 Anxiety
3
TEST Three 456 1970
Pain 4

I would like to have the results in the follow order:

Patient_Name Account_No Birthdate Pain Anxiety
Nausea
Test One 123 1950
2 5
Test TWO 234
1980 1
TEST Three 456 1970
4 3

Is there anybody who can help me.
NewBee:

If you are only dealing with a few 'Result' options, and your data is
consistently entered, then you can add columns to your query like this
(Paste each of these lines into a blank column of your query grid):

Pain: IIF([Result] = "Pain",[Result Value])
Anxiety: IIF([Result] = "Anxiety",[Result Value])
Nausea: IIF([Result] = "Nausea",[Result Value])

HTH,
Jana

Mar 29 '07 #2
On Mar 29, 1:01 pm, "Jana" <Bauer.J...@gmail.comwrote:
On Mar 29, 10:06 am, "NewBee" <cuta...@gmail.comwrote:


Hi,
I am new in the field and might be asking a dumb question, but please
I still need help.
I am running the Business Object 5.1.8, and using Freehand SQL with
Oracle 8.1 connecting.
I have four columns e;g
Patient_Name Account_No Birthdate Result Result
Value
Test One 123 1950
Pain 2
Test One 123 1950
Anxiety 5
Test TWO 234 1980 Nausea
1
TEST Three 456 1970 Anxiety
3
TEST Three 456 1970
Pain 4
I would like to have the results in the follow order:
Patient_Name Account_No Birthdate Pain Anxiety
Nausea
Test One 123 1950
2 5
Test TWO 234
1980 1
TEST Three 456 1970
4 3
Is there anybody who can help me.

NewBee:

If you are only dealing with a few 'Result' options, and your data is
consistently entered, then you can add columns to your query like this
(Paste each of these lines into a blank column of your query grid):

Pain: IIF([Result] = "Pain",[Result Value])
Anxiety: IIF([Result] = "Anxiety",[Result Value])
Nausea: IIF([Result] = "Nausea",[Result Value])

HTH,
Jana- Hide quoted text -

- Show quoted text -
This is, of course, assuming you're using Access. Since you specified
several other programs, I'm not sure if you intended to post to an
Access group. If you need the same functionality within an SQL
statement, it would be something like this:

SELECT Patient_Name, Account_No, Birthdate,
IF Result = 'Pain'
THEN Result_Value
ENDIF AS Pain,
IF Result = 'Anxiety'
THEN Result_Value
ENDIF AS Anxiety,
IF Result = 'Nausea'
THEN Result_Value
ENDIF AS Nausea
FROM YourTableName
Jana

Mar 29 '07 #3

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

Similar topics

18
by: Robin Lawrie | last post by:
Hi again, another problem! I've moved from an Access database to SQL server and am now having trouble inserting dates and times into seperate fields. I'm using ASP and the code below to get the...
3
by: Carmine | last post by:
I have to add a date column to a db2/zos table with a blob column. Can I rename the blob table to old, create a new table with the date column, then insert/select the data from the old table? ...
20
by: Steve Jorgensen | last post by:
Hi all, I've just finished almost all of what has turned out to be a real bear of a project. It has to import data from a monthly spreadsheet export from another program, and convert that into...
3
by: CSDunn | last post by:
Hello, I have a situation with MS Access 2000 in which I need to display report data in spreadsheet orientation (much like a datasheet view for a form). If you think of the report in terms of what...
6
by: Alpha | last post by:
I retrieve a table with only 2 columns. One is a auto-generated primary key column and the 2nd is a string. When I add a new row to the dataset to be updated back to the database. What should I...
5
by: VB Programmer | last post by:
I have a simple datagrid on a webform. (I'm using VB.NET.) In the page load I get some data, set the .DataSource property of the dg, then do a .DataBind. The columns are automatically created. ...
1
by: Brad | last post by:
Thanks for taking the time to read my question. I have a table of data that has Date, Data and Category. I need to show, in a report, each Categories Data by Date. The Date has to be it's own...
4
by: cooltech77 | last post by:
Hi, I am trying to build the following functionality in the datagrid. I have a lot of columns in the datagrid which are being populated from the database and the user needs to scroll...
2
by: pipeme | last post by:
Hi I am not terribly proficient in access coding so please excuse my ignorance if this is easier than what I think it will be! I have a query which has 3 columns and varying amounts of records...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.