Showing posts with label appreciate. Show all posts
Showing posts with label appreciate. Show all posts

Wednesday, March 21, 2012

Joining two datasets in a report

Good afternoon,
This is actually quite urgent and I'd really appreciate any helpful
responses.
Is it possible to join two datasets into a single report based on a specific
column in each dataset? That is, if I have dataset 'dspatient' and dataset
'dsvisits', I'd like to join the two separate datasets on patient_id which
is present in each dataset and display the results.
How might I accomplish this? I should also mention these datasets are
created by two different datasources.
Any help would be greatly appreciated.
Thank you,
JayThis is a multi-part message in MIME format.
--=_NextPart_000_003E_01C53E7B.9989C690
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
Jay,
Do both of the datasets live on the same server but just different
databases? I'm assuming that since you are using SQL Server 2000?
Mark
--Original Message--
From: Jason [mailto:jason@.grossmans.net]
Posted At: Friday, April 08, 2005 6:15 PM
Posted To: microsoft.public.sqlserver.reportingsvcs
Conversation: Joining two datasets in a report
Subject: Joining two datasets in a report
Good afternoon,
This is actually quite urgent and I'd really appreciate any helpful
responses.
Is it possible to join two datasets into a single report based on a
specific column in each dataset? That is, if I have dataset 'dspatient'
and dataset 'dsvisits', I'd like to join the two separate datasets on
patient_id which is present in each dataset and display the results.
How might I accomplish this? I should also mention these datasets are
created by two different datasources.
Any help would be greatly appreciated.
Thank you,
Jay
--=_NextPart_000_003E_01C53E7B.9989C690
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
&

Dataset clarification
Jay,
Do both of the datasets live on the same server but =just different databases? I'm assuming that since you are using =SQL Server 2000?
Mark
--Original Message--
From: Jason [mailto:jason@.grossmans.net] =Posted At: Friday, April 08, 2005 6:15 PM
Posted To: =microsoft.public.sqlserver.reportingsvcs
Conversation: Joining two datasets in a report
Subject: Joining two datasets in a report
Good afternoon,
This is actually quite urgent and I'd really =appreciate any helpful responses.
Is it possible to join two datasets into a single =report based on a specific column in each dataset? That is, if I =have dataset 'dspatient' and dataset 'dsvisits', I'd like to join the =two separate datasets on patient_id which is present in each dataset and =display the results.
How might I accomplish this? I should also =mention these datasets are created by two different datasources.
Any help would be greatly appreciated.
Thank you,
Jay


--=_NextPart_000_003E_01C53E7B.9989C690--|||This is a multi-part message in MIME format.
--=_NextPart_000_002E_01C53E77.5A06E9C0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Dataset clarificationOne database is on sqlserver 2000 and the other is =on a vms/vax box, but both datasets are currently in one report (I'm not =sure how I'd store a dataset in a database directly). So, basically I =can get two separate datasets into my report, but cannot make a join on =these datasets for the report.
Thanks!
"Mark Monica" <mmonica@.stf.com> wrote in message =news:%231Wvh0pPFHA.2932@.TK2MSFTNGP09.phx.gbl...
Jay,
Do both of the datasets live on the same server but just different =databases? I'm assuming that since you are using SQL Server 2000?
Mark
--Original Message-- From: Jason [mailto:jason@.grossmans.net] Posted At: Friday, April 08, 2005 6:15 PM Posted To: microsoft.public.sqlserver.reportingsvcs Conversation: Joining two datasets in a report Subject: Joining two datasets in a report
Good afternoon,
This is actually quite urgent and I'd really appreciate any helpful =responses.
Is it possible to join two datasets into a single report based on a =specific column in each dataset? That is, if I have dataset 'dspatient' =and dataset 'dsvisits', I'd like to join the two separate datasets on =patient_id which is present in each dataset and display the results.
How might I accomplish this? I should also mention these datasets are =created by two different datasources.
Any help would be greatly appreciated.
Thank you,
Jay --=_NextPart_000_002E_01C53E77.5A06E9C0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&
Dataset clarification
One database is on sqlserver 2000 and =the other is on a vms/vax box, but both datasets are currently in one report (I'm not =sure how I'd store a dataset in a database directly). So, basically I =can get two separate datasets into my report, but cannot make a join on these =datasets for the report.
Thanks!
"Mark Monica" wrote in =message news:%231Wvh0pPFHA.=2932@.TK2MSFTNGP09.phx.gbl...
Jay,
Do both of the datasets live on the same server but =just different databases? I'm assuming that since you are using SQL =Server 2000?
Mark
--Original Message-- From: Jason [mailto:jason@.grossmans.net] Posted At: Friday, April 08, 2005 6:15 =PM Posted To: =microsoft.public.sqlserver.reportingsvcs Conversation: Joining two datasets in a =report Subject: Joining two datasets in a report = Good afternoon,
This is actually quite urgent and I'd really =appreciate any helpful responses.
Is it possible to join two datasets into a single =report based on a specific column in each dataset? That is, if I have dataset = 'dspatient' and dataset 'dsvisits', I'd like to join the two separate =datasets on patient_id which is present in each dataset and display the results.
How might I accomplish this? I should also =mention these datasets are created by two different datasources.
Any help would be greatly appreciated.
Thank you,
Jay

--=_NextPart_000_002E_01C53E77.5A06E9C0--|||This is a multi-part message in MIME format.
--=_NextPart_000_0071_01C53E82.4266EF80
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Dataset clarificationYou cannot joing two datasets together. You have =two choices, do this in a stored procdure using linked databases (be =careful or you can really have performance problems. You should use =openquery and not 4 part naming if using linked databases). Or you can =use subreports.
-- Bruce Loehle-Conger MVP SQL Server Reporting Services
"Jason" <jason@.grossmans.net> wrote in message =news:eOJtlmqPFHA.2132@.TK2MSFTNGP14.phx.gbl...
One database is on sqlserver 2000 and the other is on a vms/vax box, =but both datasets are currently in one report (I'm not sure how I'd =store a dataset in a database directly). So, basically I can get two =separate datasets into my report, but cannot make a join on these =datasets for the report.
Thanks!
"Mark Monica" <mmonica@.stf.com> wrote in message =news:%231Wvh0pPFHA.2932@.TK2MSFTNGP09.phx.gbl...
Jay,
Do both of the datasets live on the same server but just different =databases? I'm assuming that since you are using SQL Server 2000?
Mark
--Original Message-- From: Jason [mailto:jason@.grossmans.net] Posted At: Friday, April 08, 2005 6:15 PM Posted To: microsoft.public.sqlserver.reportingsvcs Conversation: Joining two datasets in a report Subject: Joining two datasets in a report
Good afternoon,
This is actually quite urgent and I'd really appreciate any helpful =responses.
Is it possible to join two datasets into a single report based on a =specific column in each dataset? That is, if I have dataset 'dspatient' =and dataset 'dsvisits', I'd like to join the two separate datasets on =patient_id which is present in each dataset and display the results.
How might I accomplish this? I should also mention these datasets =are created by two different datasources.
Any help would be greatly appreciated.
Thank you,
Jay --=_NextPart_000_0071_01C53E82.4266EF80
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&
Dataset clarification
You cannot joing two datasets together. =You have two choices, do this in a stored procdure using linked databases (be =careful or you can really have performance problems. You should use openquery and =not 4 part naming if using linked databases). Or you can use =subreports.
-- Bruce Loehle-Conger MVP =SQL Server Reporting Services
"Jason" wrote =in message news:eOJtlmqPFHA.2132=@.TK2MSFTNGP14.phx.gbl...
One database is on sqlserver 2000 and =the other is on a vms/vax box, but both datasets are currently in one report =(I'm not sure how I'd store a dataset in a database directly). So, =basically I can get two separate datasets into my report, but cannot make a join =on these datasets for the report.

Thanks!


"Mark Monica" wrote in =message news:%231Wvh0pPFHA.=2932@.TK2MSFTNGP09.phx.gbl...
Jay,
Do both of the datasets live on the same server =but just different databases? I'm assuming that since you are using SQL =Server 2000?
Mark
--Original Message-- From: Jason [mailto:jason@.grossmans.net] Posted At: Friday, April 08, 2005 6:15 =PM Posted To: =microsoft.public.sqlserver.reportingsvcs Conversation: Joining two datasets in a =report Subject: Joining two datasets in a report = Good afternoon,
This is actually quite urgent and I'd really =appreciate any helpful responses.
Is it possible to join two datasets into a single =report based on a specific column in each dataset? That is, if I have =dataset 'dspatient' and dataset 'dsvisits', I'd like to join the two =separate datasets on patient_id which is present in each dataset and display =the results.
How might I accomplish this? I should also =mention these datasets are created by two different datasources.
Any help would be greatly appreciated.
Thank you,
Jay =

--=_NextPart_000_0071_01C53E82.4266EF80--|||This is a multi-part message in MIME format.
--=_NextPart_000_0067_01C53E7C.A4688FF0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Dataset clarificationAlright, thanks. I'll work on the subreport option =hopefully.
"Bruce L-C [MVP]" <bruce_lcNOSPAM@.hotmail.com> wrote in message =news:eDZiswqPFHA.3144@.tk2msftngp13.phx.gbl...
You cannot joing two datasets together. You have two choices, do this =in a stored procdure using linked databases (be careful or you can =really have performance problems. You should use openquery and not 4 =part naming if using linked databases). Or you can use subreports.
-- Bruce Loehle-Conger MVP SQL Server Reporting Services
"Jason" <jason@.grossmans.net> wrote in message =news:eOJtlmqPFHA.2132@.TK2MSFTNGP14.phx.gbl...
One database is on sqlserver 2000 and the other is on a vms/vax box, =but both datasets are currently in one report (I'm not sure how I'd =store a dataset in a database directly). So, basically I can get two =separate datasets into my report, but cannot make a join on these =datasets for the report.
Thanks!
"Mark Monica" <mmonica@.stf.com> wrote in message =news:%231Wvh0pPFHA.2932@.TK2MSFTNGP09.phx.gbl...
Jay,
Do both of the datasets live on the same server but just different =databases? I'm assuming that since you are using SQL Server 2000?
Mark
--Original Message-- From: Jason [mailto:jason@.grossmans.net] Posted At: Friday, April 08, 2005 6:15 PM Posted To: microsoft.public.sqlserver.reportingsvcs Conversation: Joining two datasets in a report Subject: Joining two datasets in a report
Good afternoon,
This is actually quite urgent and I'd really appreciate any =helpful responses.
Is it possible to join two datasets into a single report based on =a specific column in each dataset? That is, if I have dataset ='dspatient' and dataset 'dsvisits', I'd like to join the two separate =datasets on patient_id which is present in each dataset and display the =results.
How might I accomplish this? I should also mention these datasets =are created by two different datasources.
Any help would be greatly appreciated.
Thank you,
Jay --=_NextPart_000_0067_01C53E7C.A4688FF0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&
Dataset clarification
Alright, thanks. I'll work on the =subreport option hopefully.
"Bruce L-C [MVP]" wrote in message news:eDZiswqPFHA.3144=@.tk2msftngp13.phx.gbl...
You cannot joing two datasets =together. You have two choices, do this in a stored procdure using linked databases (be =careful or you can really have performance problems. You should use openquery =and not 4 part naming if using linked databases). Or you can use subreports.

-- Bruce Loehle-Conger =MVP SQL Server Reporting Services

"Jason" =wrote in message news:eOJtlmqPFHA.2132=@.TK2MSFTNGP14.phx.gbl...
One database is on sqlserver 2000 =and the other is on a vms/vax box, but both datasets are currently in one report =(I'm not sure how I'd store a dataset in a database directly). So, =basically I can get two separate datasets into my report, but cannot make a join =on these datasets for the report.

Thanks!


"Mark Monica" wrote in =message news:%231Wvh0pPFHA.=2932@.TK2MSFTNGP09.phx.gbl...
Jay,
Do both of the datasets live on the same server =but just different databases? I'm assuming that since you are using =SQL Server 2000?
Mark
--Original Message-- From: Jason [mailto:jason@.grossmans.net] Posted At: Friday, April 08, 2005 6:15 =PM Posted To: microsoft.public.sqlserver.reportingsvcs Conversation: Joining two datasets in a report =Subject: Joining two datasets in a report
Good afternoon,
This is actually quite urgent and I'd really =appreciate any helpful responses.
Is it possible to join two datasets into a =single report based on a specific column in each dataset? That is, if I =have dataset 'dspatient' and dataset 'dsvisits', I'd like to join the =two separate datasets on patient_id which is present in each dataset =and display the results.
How might I accomplish this? I should also =mention these datasets are created by two different datasources. = Any help would be greatly appreciated. = Thank you,
Jay

--=_NextPart_000_0067_01C53E7C.A4688FF0--sql

Friday, March 9, 2012

Join Translation in SQL Server

Hi
Can any one please translate these oracle inner join and outer join in SQL
Server. Any help will be highly appreciate.

SELECT V1.DB_VENDOR V1.NAME1,1,21)||DECODE(B1.JOINT_DESC,NULL,'',
'(JV)')||
DECODE(B1.NON_RESP,'Y','(NR)',
'N','') V1_NAME1,
B2.DB_CONTRACT B2_DB_CONTRACT, B2.BID_VENDOR B2_BID_VENDOR, B2.RANK_NUMB B2_RANK_NUMB,
V2.DB_VENDOR V2_DB_VENDOR,
SUBSTR(V2.NAME1,1,21)||DECODE(B2.JOINT_DESC,NULL,' ',
'(JV)')||
DECODE(B2.NON_RESP,'Y','(NR)',
'N','') V2_NAME1
FROM BID_TOTAL B1, BID_TOTAL B2, VENDOR V1, VENDOR V2
WHERE V1.DB_VENDOR = B1.BID_VENDOR
AND V2.DB_VENDOR (+) = B2.BID_VENDOR
AND B1.DB_CONTRACT = B2.DB_CONTRACT (+)
AND B1.RANK_NUMB > 1
AND MOD(B1.RANK_NUMB,2) = 0
AND B2.RANK_NUMB (+) = B1.RANK_NUMB + 1
AND B2.DB_CONTRACT IS NOT NULL
and b2.db_Contract=39624
ORDER BY B1.RANK_NUMBThey are all INNER JOINed. The (+) means (I think) the same as (INDEX=) hint. I'm having bigger problems with DECODE, don't have anything on Horacle handy at this point ;)|||any more help from some on on join?|||SELECT SUBSTR(V1.DB_VENDOR V1.NAME1,1,21)
+ CASE WHEN B1.JOINT_DESC IS NULL THEN '' ELSE '(JV)' END
+ CASE WHEN B1.NON_RESP = 'Y' THEN '(NR)'
WHEN B1.NON_RESP = 'N' THEN ''
END AS V1_NAME1
, B2.DB_CONTRACT AS B2_DB_CONTRACT
, B2.BID_VENDOR AS B2_BID_VENDOR
, B2.RANK_NUMB AS B2_RANK_NUMB
, V2.DB_VENDOR AS V2_DB_VENDOR
, SUBSTR(V2.NAME1,1,21)
+ CASE WHEN B2.JOINT_DESC IS NULL THEN '' ELSE '(JV)' END
+ CASE WHEN B2.NON_RESP = 'Y' THEN '(NR)'
WHEN B2.NON_RESP = 'N' THEN ''
END AS V2_NAME1
FROM BID_TOTAL B1
LEFT JOIN BID_TOTAL B2 ON B1.DB_CONTRACT = B2.DB_CONTRACT (+)
INNER JOIN VENDOR V1 ON V1.DB_VENDOR = B1.BID_VENDOR
RIGHT JOIN VENDOR V2 ON V2.DB_VENDOR (+) = B2.BID_VENDOR
WHERE B1.RANK_NUMB > 1
AND MOD(B1.RANK_NUMB,2) = 0
AND B2.DB_CONTRACT IS NOT NULL
AND b2.db_Contract=39624
ORDER BY B1.RANK_NUMB|||Hi Brett,

the mod function line is giving me error. I chanaged to this:
AND B1.RANK_NUMB % '2' = '0'
but it is still giving me error i.e.

Operand type clash: varchar is incompatible with void type
Server: Msg 8117, Level 16, State 1, Line 1
Operand data type numeric is invalid for modulo operator.

Thank you very much for immediate help.

waiting for response|||I forget what MOD does...do you know?|||Hi Brett.

Mod return the remainder of a division|||Hi Brett.

Mod return the remainder of a division

Well then that's a bizarre predicate

AND B1.RANK_NUMB/2.00-FLOOR(B1.RANK_NUMB/2.00) = 0|||AND cast(B1.RANK_NUMB as int) % 2 = 0|||What does this do again?

SELECT cast(100.00/20.00 as int) % 2|||Hi Brett,

Thank you very much...it worked