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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Need Urgent Help

Author  Topic 

GaneshRamanan
Starting Member

40 Posts

Posted - 2011-01-25 : 13:10:34
Can any one pls GUIDE Me to get the output like this

pmrid Patientid Bp Value Date
1 1 null 10 2011/01/01
2 1 90 2 2011/01/02
3 1 80 3 2011/01/03

I need the output

Parameter PATIENID DATE
BP 1 2011/01/01
BP 1 2011/01/02
BP 1 2011/01/03

Thanks,
Ganesh

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2011-01-25 : 13:50:47
Select 'BP',PatientID,Date
From yourTable



Jim

Everyday I learn something that somebody else already knew
Go to Top of Page

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2011-01-25 : 13:56:37
quote:
Originally posted by jimf

Select 'BP' AS Parameter,PatientID,Date
From yourTable



Jim

Everyday I learn something that somebody else already knew

Go to Top of Page

GaneshRamanan
Starting Member

40 Posts

Posted - 2011-01-25 : 14:06:06
ROWId EMPID VALUE VALUE2 date
2 3 10.00 NULL 2011-01-21 00:00:00.000
3 3 10.00 NULL 2011-01-21 00:00:00.000
4 3 10.00 NULL 2011-01-21 00:00:00.000
5 3 10.00 NULL 2011-01-21 00:00:00.000
6 3 10.00 NULL 2011-01-22 00:00:00.000
7 15 10.00 NULL 2011-01-22 00:00:00.000
8 15 10.00 NULL 2011-01-22 00:00:00.000
9 15 10.00 NULL 2011-01-22 00:00:00.000
10 15 10.00 NULL 2011-01-22 00:00:00.000
11 15 10.00 NULL 2011-01-22 00:00:00.000

I need output for this table

Parameter ROWID EMPid date
VALUE 2 3 2011/01/22
VALUE 3 3 2011/01/22
VALUE 4 3 2011/01/22
VALUE 5 3 2011/01/22
VALUE 6 3 2011/01/22
VALUE2 7 15 2011/01/22
VALUE2 7 15 2011/01/22
VALUE2 7 15 2011/01/22
VALUE2 7 15 2011/01/22


Go to Top of Page

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2011-01-25 : 14:20:36
Let the games begin! I'm guessing that you want to return certain records based on a parameter sent in to a stored procedure?

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page

GaneshRamanan
Starting Member

40 Posts

Posted - 2011-01-25 : 14:22:12
YES, I PASSING PARAMETER ROWID,EMPID IN THE SP

Go to Top of Page

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2011-01-25 : 15:10:36
And how are you passing them in? Passing in specific ROWIDs makes passing in EMPId pointless.

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page
   

- Advertisement -