Help With Multi Join Or Multi Tier Select.

Jul 20, 2005

Hello,

I am trying to construct a query across 5 tables but primarily 3
tables. Plan, Provider, ProviderLocation are the three primary tables
the other tables are lookup tables for values the other tables.
PlanID is the primary in Plan and

PlanProviderProviderLocationLookups
---------------------------------------------
PlanIDProviderIDProviderIDLookupType
PlanNamePlanIDProviderStatusLookupKey
RegionIDLastName...LookupValue
....FirstName...

Given a PlanID I want all the Providers with a ProviderStatus = 0

I can get the query to work just fine if there are records but what I
want is if there are no records then I at least want one record with
the Plan information. Here is a sample of the Query:

SELECT pln.PlanName, pln.PlanID, l3.LookupValue as Region,
p.ProviderID, p.SSNEIN, pl.DisplayLocationOnPCP,
pl.NoDisplayDate, pl.ProviderStatus, pl.InvalidDate,
l1.LookupValue as ReasonMain, l2.LookupValue as ReasonSub,
pl.InvalidData
FROM Plans pln
INNER JOIN Lookups l3 ON l3.LookupType = 'REGN'
AND pln.RegionID = l3.Lookupkey
left outer JOIN Provider p ON pln.PlanID = p.PlanID
left outer JOIN ProviderLocation pl ON p.ProviderID = pl.ProviderID
left outer JOIN Lookups l1 ON l1.LookupType = 'PLRM'
AND pl.ReasonMain = l1.LookupKey
left outer JOIN Lookups l2 ON l2.LookupType = 'PLX1'
AND pl.ReasonSub = l2.Lookupkey
WHERE pln.PlanID = '123456789' AND pl.ProviderStatus = 0
ORDER BY p.PlanID, p.ProviderID, pl.SiteLocationNum

I know the problew the ProviderStatus on the Where clause is keeping
any records from being returned but I'm not good enough at this to
another select.

Can anybody give me some suggestions?

Thanks

David

View 5 Replies


ADVERTISEMENT

DTSRUN: To Multi-tier Or Not To Multi-tier. That Is The Question...

Jul 20, 2005

Greetings,We are trying to set up a set of "Leading Practices" for ourdevelopers, as well as ourselves, and hope some gentle reader canrecommend some documentation in favor of what appears to be the rightposition to take.We do not allow third party applications to run on our SQL Servers. Wewant to include DTS Packages under the definition of third partyapplications, insisting instead that the developers save theirpackages as COM Formatted files into their source code control systemsand run them from their app servers. The devlopers would like to hearthis from someone besides ourselves.While strong recomendations to remove guest access to MSDB altogetherabound, I have been unable to find a straight forward discussion ofthe advantages of structured file storage and app server off load ofDTS packages.Can anyone suggest any articles, white papers, rants, etc attemptingto formulate a solution to the benefits of taking msdb away fromguest, with the advantages of running DTS from an App server orworkstation platform, with the packages protected in source codecontrol?Thank youJohn Pollinsjpollins @ eqt . com

View 2 Replies View Related

Select From Linked Server Using Join, The Multi-part Identifier Could Not Be Bound.

Nov 6, 2006

Hello,

i am facing a bizarre problem, accessing data from a remote server which has been linked to my sql.
My SQL server is 2005 and the remote server is SQL 2000.
i have linked the remote server (called LinkedServer) so that when i run this query:
SELECT * FROM LinkedServer.SomeDB.dbo.SomeTable
executes successfully! However, when i run a similar query like this:
SELECT Column1 AS Col1,
LinkedServer.SomeDB.dbo.SomeTable.Column2 as Col2,
Alias.Column3 as Col3
FROM LinkedServer.SomeDB.dbo.SomeTable
INNER JOIN LinkedServer.SomeDB.dbo.SomeOtherTable1 ON LinkedServer.SomeDB.dbo.SomeTable.Column3 = LinkedServer.SomeDB.dbo.SomeOtherTable1.Column3

INNER JOIN LinkedServer.SomeDB.dbo.SomeOtherTable2 AS Alias
ON LinkedServer.SomeDB.dbo.SomeTable.Column3 = Alias.Column3

It gives me this error:
The multi-part identifier "LinkedServer.SomeDB.dbo.SomeTable.Column2" could not be bound.
The multi-part identifier "LinkedServer.SomeDB.dbo.SomeTable.Column3" could not be bound.
I have noticed that this error is generated only for the selected columns whose path has either been repeated (e.g. "LinkedServer.SomeDB.dbo.SomeTable.Column2" as opposed to "Column2") or for columns which are from aliased tables.

What is going on?!?!?!??!?!?!

Any Help would be tremendously appreciated!!!! 8..)

View 8 Replies View Related

Transact SQL :: Difference Between Inner Join And Left Outer Join In Multi-table Joins?

Oct 8, 2015

I was writing a query using both left outer join and inner join.  And the query was ....

SELECT
        S.companyname AS supplier, S.country,P.productid, P.productname, P.unitprice,C.categoryname
FROM
        Production.Suppliers AS S LEFT OUTER JOIN
        (Production.Products AS P
         INNER JOIN Production.Categories AS C

[code]....

However ,the result that i got was correct.But when i did  the same query using the left outer join in both the cases

i.e..

SELECT
        S.companyname AS supplier, S.country,P.productid, P.productname, P.unitprice,C.categoryname
FROM
        Production.Suppliers AS S LEFT OUTER JOIN
(Production.Products AS P
LEFT OUTER JOIN Production.Categories AS C
ON C.categoryid = P.categoryid)
ON
S.supplierid = P.supplierid
WHERE
S.country = N'Japan';

The result i got was same,i.e

supplier     country    productid    productname     unitprice    categorynameSupplier QOVFD     Japan     9     Product AOZBW    97.00     Meat/PoultrySupplier QOVFD    Japan   10     Product YHXGE     31.00     SeafoodSupplier QOVFD     Japan   74     Product BKAZJ    10.00     ProduceSupplier QWUSF     Japan    13     Product POXFU     6.00     SeafoodSupplier QWUSF     Japan     14     Product PWCJB     23.25     ProduceSupplier QWUSF    Japan     15    Product KSZOI     15.50    CondimentsSupplier XYZ     Japan     NULL     NULL     NULL     NULLSupplier XYZ     Japan     NULL     NULL     NULL     NULL

and this time also i got the same result.My question is that is there any specific reason to use inner join when join the third table and not the left outer join.

View 5 Replies View Related

SQL 2012 :: Disaster Recovery Options For Multi-Database Multi-Instance Environment

Sep 23, 2014

Disaster Recovery Options based on the following criteria.

--Currently running SQL 2012 standard edition
--We have 18000 databases (same schema across databases)- majority of databases are less than 2gb-- across 64 instances approximately
--Recovery needs to happen within 1 hour (Not sure that this is realistic
-- We are building a new data center and building dr from the ground up.

What I have looked into is:

1. Transactional Replication: Too Much Data Not viable
2. AlwaysOn Availability Groups (Need enterprise) Again too many databases and would have to upgrade all instances
3. Log Shipping is a viable option and the only one I can come up with that would work right now. Might be a management nightmare but with this many databases probably all options with be a nightmare.

View 1 Replies View Related

SQL 2012 :: MSDTC In Multi-node / Multi-instanced Cluster

Aug 17, 2015

More often than not, I typically don't touch DTC on clusters anymore; however on a project where the vendor states that it's required. So a couple things here.

1) Do you really need DTC per instance or one for all?
2) Should DTC be in its own resource group or within the instance's group?
2a) If in it's own resource group, how do you tie an instance to an outside resource group? tmMappingSet right?

View 9 Replies View Related

The Multi Delete && Multi Update - Stored Procedure Not Work Ok

Feb 4, 2008

the stored procedure don't delete all the records
need help



Code Snippet
DECLARE @empid varchar(500)
set @empid ='55329429,58830803,309128726,55696314'
DELETE FROM [Table_1]
WHERE charindex(','+CONVERT(varchar,[empid])+',',','+@empid+',') > 0
UPDATE [empList]
SET StartDate = CONVERT(DATETIME, '1900-01-01 00:00:00', 102), val_ok = 0
WHERE charindex(','+CONVERT(varchar,[empid])+',',','+@empid+',') > 0
UPDATE [empList]
SET StartDate = CONVERT(DATETIME, '1900-01-01 00:00:00', 102), val_ok = 0
WHERE charindex(','+CONVERT(varchar,[empid])+',',','+@empid+',') > 0




TNX

View 2 Replies View Related

Multi-table JOIN Query With More Than One JOIN Statement

Apr 14, 2015

I'm having trouble with a multi-table JOIN statement with more than one JOIN statement.

For each order, I need to return the following: CarsID, CarModelName, MakeID, OrderDate, ProductName, Total ordered the Car Category.

The carid (primary key) and carmodelname belong to the Cars table.
The makeid and orderdate belong to the OrderDetails table.
The productname and carcategory belong to the Product table.

The number of rows returned should be the same as the number of rows in OrderDetails.

View 2 Replies View Related

Join Multi Server

Oct 9, 2006

hi,consider this:i have american users in a db called "user" in a server called AMERICAand rest of the world users in a db called "user" in a server called OTHERhow can i do a join betwhen  American's users and Rest of the word's User db?   

View 3 Replies View Related

Multi-Table Join Help

Feb 7, 2002

I want only one row for each contact that contains the most recent calendar as enddate and most recent history as ondate. I'm getting multiple rows for each matching contact.

--------------------------------------
select c1.contact ,ca.enddate ,ch.ondate

from ca

join c1 on ca.accountno = c1.accountno

join ch on ca.accountno = ch.accountno

where ca.ondate in (select max(ondate) from ca group by accountno)
------------------------------------------

View 1 Replies View Related

Multi Database Join

Apr 8, 1999

Is it possible to create a join between two SQL Server DB's on the same server? What is the syntax?

View 1 Replies View Related

Multi Join Stored Proc

Nov 20, 2007

Hi,
Why does the below not return any results???
Colorcodes mark the related keys.

Thanks.


Tables:
FundClient (ClientID PK, Client)

FundPortfolio (PortfolioID PK, Portfolio, ClientID FK)

Staff(StaffID PK, SeniorMgr, ClientID FK, FundID FK)

myLegal(myID PK, LegalCounsel FK, ClientID FK, FundID FK)

FullLegalList(LegalID PK, LegalName)





Code Block
@LegalCounsel int = 0,
@ClientID int = 0,
@FundID int = 0

DECLARE @thisQuery as varchar(max)

SET @thisQuery = 'SELECT p.Portfolio, SeniorMgr, fl.Legal FROM FundClient f'
BEGIN
SET @thisQuery = @thisQuery + ' INNER JOIN FundPortfolio p
ON p.ClientID = f.ClientID'
END
BEGIN
SET @thisQuery = @thisQuery + ' LEFT OUTER JOIN Staff s
ON (s.ClientID = p.ClientID AND s.FundID = p.PortfolioID AND s.ClientID = f.ClientID)'
END
BEGIN
SET @thisQuery = @thisQuery + ' LEFT OUTER JOIN myLegal l
ON (l.ClientID = p.ClientID AND l.FundID = p.PortfolioID)
INNER JOIN FullLegalList fl
ON fl.LegalID = l.LegalCounsel'
END
BEGIN
IF @Legal != 0
SET @thisQuery3 = @thisQuery3 + ' WHERE rl.Legal = ' + cast(@LegalCounsel as varchar(11))
END
BEGIN
IF @ClientID != 0
SET @thisQuery = @thisQuery + ' AND p.ClientID = ' + cast(@ClientID as varchar(11))
END
BEGIN
IF @FundID != 0
SET @thisQuery = @thisQuery + ' AND p.PortfolioID = ' + cast(@FundID as varchar(11))
END
BEGIN
SET @thisQuery = @thisQuery + ';'
END





View 12 Replies View Related

Multi-table Join Problem

Jan 9, 2008

Hello All,

I have three tables A, B, and C.
What i want to do is basically left join A with B, then left join B with C.
However when try to do this it won't work out as i imagined.
Is there a better way (one that works) for accomplishing what i am trying to do?

Any help is much appreciated.

Thanks,

View 7 Replies View Related

Help Me! Convert SQL Syntax To LINQ With Multi Join

May 5, 2008

Hi...
I have 3 tables:SportTeams (TeamID, TeamName)SportAthletes (TeamID, AthleteID, AthleteName)SportMedals (AthleteID, Medal)
I want to have a brief medal list (TeamID, G, S, B). I can write query in systax:
Select a.TeamID, a.TeamName_en,g.G,s.S,b.B from SportTeams aLeft Join(Select c.TeamID,Count(*) as G from SportMedals b Inner Join SportAthletes c On b.AthleteID = c.AthleteIDWhere Medal = 'G'Group By c.TeamID) g On a.TeamID = g.TeamIDLeft Join(Select c.TeamID,Count(*) as S from SportMedals b Inner Join SportAthletes c On b.AthleteID = c.AthleteIDWhere Medal = 'S'Group By c.TeamID) s On a.TeamID = s.TeamIDLeft Join(Select c.TeamID,Count(*) as B from SportMedals d Inner Join SportAthletes c On d.AthleteID = c.AthleteIDWhere Medal = 'B'Group By c.TeamID) b On a.TeamID = b.TeamIDOrder By g.G desc, s.S desc, b.B desc, a.TeamID asc
But I can't write it in LINQ syntax (I am beginner with C#, LINQ)
Can you help this sample to LINQ systax?
Thanks!

View 5 Replies View Related

Multi-database Multi-server

Mar 27, 2007

I am new to Reporting Services and hope that what I am looking to do is within capabilities :-)



I have many identical schema databases residing on a number of data servers. These support individual clients accessing them via a web interface. What I need to be able to do is run reports across all of the databases. So the layout is:



Dataserver A

Database A1

Database A2

Database A3



Dataserver B

Database B1

Database B2



Dataserver C

Database C1

Database C2

Database C3



I would like to run a report that pulls table data from A1, A2, A3, B1, B2, C1, C2, C3



Now the actual number of servers is 7 and the number of databases is close to 1000. All servers are running SQL2005.



Is this something that Reporting Services is able to handle or do I need to look at some other solution?



Thanks,



Michael

View 5 Replies View Related

Ambiguous Column Names In Multi-Table Join

Jun 21, 2006

Hi all,A (possibly dumb) question, but I've had no luck finding a definitiveanswer to it. Suppose I have two tables, Employees and Employers, whichboth have a column named "Id":Employees-Id-FirstName-LastName-SSNetc.Employers-Id-Name-Addressetc.and now I perform the following join:SELECT Employees.*, Employers.*FROM Employees LEFT JOIN Employers ON (Employees.Id=Employers.Id)The result-set will contain two "Id" columns, so SQL Server willdisambiguate them; one column will still be called "Id", while theother will be called "Id1." My question is, how are you supposed toknow which "Id" column belongs to which table? My intuition tells me,and limited testing seems to indicate, that it depends on the order inwhich the table names show up in the query, so that in the aboveexample, "Id" would refer to Employees.Id, while "Id1" would refer toEmployers.Id. Is this order guaranteed?Also, why does SQL Server use such a IMO brain-damaged technique tohandle column name conflicts? In MS Access, it's much morestraightforward; after executing the above query, you can use"Employees.Id" and "Employers.Id" (and more generally,"TableNameOrTableAlias.ColumnName") to refer to the specific "Id"column you want, instead of "Id" and "Id1" -- the"just-tack-on-a-number" strategy is slightly annoying when dealing withcomplex queries.--Mike S

View 6 Replies View Related

(Select All) In Multi-select Enabled Drop Down Parameters Doesn't Work

Apr 29, 2008

Hello all,
I have two mult-value parameters in my report. Both of them working with selecting one or more values. But, when I test using "(Select All)" values for both parameters , only one parameter works. The "available values" for these two parameters are both from the data set.

select distinct ProductType
from Product
order by ProductType

Any suggestion? thx


View 12 Replies View Related

Remove Select All Options From Multi Select Parameter Dropdown

Jun 8, 2007

Hi All



I am using SQL Server 2005 with SP2. I have multi select parameter in the report. In SP2 reporting services gives Select All option in the drop down.



Is there any way I can remove that option from the list?



Thanks

View 4 Replies View Related

Left Outer Join / Multi-part Identifier Error

Jul 22, 2014

I'm writing a query where I have multiple left-outer joins but I keep getting multi-part identifier error. See the query below?

SELECT gl.seg5 Natural
,gl.seg2 Office
,gl.seg3 Dept
,gl.seg4 Team
,gl.seg6 Sub
,gl.seg7 Tkpr
,gl.seg1 Comp
,'CHK' Source

[Code] ....

Errors

Msg 4104, Level 16, State 1, Line 68
The multi-part identifier "csddt.baid" could not be bound.
Msg 4104, Level 16, State 1, Line 68
The multi-part identifier "csddt.cknum" could not be bound.
Msg 4104, Level 16, State 1, Line 68
The multi-part identifier "csddt.ckline" could not be bound.

View 5 Replies View Related

(Select All) In Multi-select Enabled Drop Down Parameters

Feb 27, 2008

There are several parameters on a report. One of the parameter is a multi-select enabled parameter and I suppressed the value "All" showing as one of the item in the drop down list, simply by filter out the [bha].[bha].CURRENTMEMBER.LEVEL.ORDINAL to 1, as "(Select All)" is pre-assigned to the drop list when multi-select is enabled and it is confusing to show "(Select All)" and "All" in the drop list. However I have another report which is linked to this report and the value which is required to pass to this report for this parameter is "All". Can I pass the "Select All" as a parameter from the other report? If so, how? Thanks.

View 1 Replies View Related

Multi Field Select Using IN...

Oct 27, 2006

here is what i am wanting to do but is it possible to use multi fields with an IN statement?

SELECT *
FROM usmastf
WHERE usm_book, usm_acct IN
(SELECT usac_book, usac_acct
FROM uscommf
WHERE usac_code = 'O/W')

View 14 Replies View Related

Multiple Multi Select And T SQL

Sep 7, 2007

I'm looking to see if there are any best known methods or better ways of handling multiple multi select parameters in reports coming from reporting services.

It's not a big deal to account for this in T-SQL when there are only a few multi-select boxes but each new one that I add creates a whole bunch more work for me. Each of these multiselect list boxes are optional filters for the report. The way that I"m handling it today is as follows:

I'm turning the multi-select lists into comma seperated variables and then using Itzik Ben-Gan's split UDF to turn them into tables that I can join to my query. I then take the base query w/out the joins and pass that into a temp table. Then I start a bunch of IF THEN program flow to either JOIN or not JOIN the results of the split UDF.

Here is my example scenarios:
Assumptions:


I have a report that has 5 input drop down lists in reporting services.

I have a user stored procedure that takes the multi-select comma seperated list and turns it into a table variable.

I cannot use Dynamic SQL because of information security policy.

The multi-select lists are optional parameters.

The Code below is accurate.... I didn't test it and just wrote it quickly to show the complexity... hopefully you get the idea.


In scenario 1: One of the drop down lists are multi-select enabled.
My SQL Sproc Would look like this:

CREATE PROCEDURE [dbo].[get_my_ssrs_data]

@Origin_Warehouse_IDs varchar(max) = '',
@Ship_To_Geo_IDs varchar(max) = '',
@Sold_To_Geo_IDs varchar(max) = '',
@Customer_Type_IDs varchar(max) = ''

WITH RECOMPILE

AS
BEGIN
SET NOCOUNT ON;
IF OBJECT_ID(N'tempdb..#MyCoreTemp', N'U') IS NOT NULL DROP TABLE #MyCoreTemp;

SELECT
Origin_Warehouse_ID
, Ship_To_Geo_ID
, Sold_To_Geo_ID
, Customer_Type_ID

INTO #MyCoreTemp

FROM
My_Fact_Table

IF @Origin_Warehouse_IDs = ''
BEGIN
SELECT * FROM #MyCoreTemp
END
ELSE
BEGIN
SELECT * FROM #MyCoreTemp MCT
JOIN udfSplit(@Origin_Warehouse_IDs,DEFALUT) OW ON (MCT.Origin_Warehouse_ID = OW.nstr)
END


In scenario 2: Two of the drop down lists are multi-select enabled.
My SQL Sproc Would look like this:

CREATE PROCEDURE [dbo].[get_my_ssrs_data]

@Origin_Warehouse_IDs varchar(max) = '',
@Ship_To_Geo_IDs varchar(max) = '',
@Sold_To_Geo_IDs varchar(max) = '',
@Customer_Type_IDs varchar(max) = ''

WITH RECOMPILE

AS
BEGIN
SET NOCOUNT ON;
IF OBJECT_ID(N'tempdb..#MyCoreTemp', N'U') IS NOT NULL DROP TABLE #MyCoreTemp;

SELECT
Origin_Warehouse_ID
, Ship_To_Geo_ID
, Sold_To_Geo_ID
, Customer_Type_ID

INTO #MyCoreTemp

FROM
My_Fact_Table

IF @Origin_Warehouse_IDs = '' AND @Ship_To_Geo_IDs = ''
BEGIN
SELECT * FROM #MyCoreTemp
END
ELSE
IF @Origin_Warehouse_IDs != '' AND @Ship_To_Geo_IDs = ''
BEGIN
SELECT * FROM #MyCoreTemp MCT
JOIN udfSplit(@Origin_Warehouse_IDs,DEFALUT) OW ON (MCT.Origin_Warehouse_ID = OW.nstr)
END
ELSE
BEGIN
SELECT * FROM #MyCoreTemp MCT
JOIN udfSplit(@Origin_Warehouse_IDs,DEFALUT) OW ON (MCT.Origin_Warehouse_ID = OW.nstr)
JOIN udfSplit(@Ship_To_Geo_IDs,DEFALUT) STG ON (MCT.Ship_To_Geo_ID = STG.nstr)
END


In scenario 3: Three of the drop down lists are multi-select enabled.
My SQL Sproc Would look like this:

CREATE PROCEDURE [dbo].[get_my_ssrs_data]

@Origin_Warehouse_IDs varchar(max) = '',
@Ship_To_Geo_IDs varchar(max) = '',
@Sold_To_Geo_IDs varchar(max) = '',
@Customer_Type_IDs varchar(max) = ''

WITH RECOMPILE

AS
BEGIN
SET NOCOUNT ON;
IF OBJECT_ID(N'tempdb..#MyCoreTemp', N'U') IS NOT NULL DROP TABLE #MyCoreTemp;

SELECT
Origin_Warehouse_ID
, Ship_To_Geo_ID
, Sold_To_Geo_ID
, Customer_Type_ID

INTO #MyCoreTemp

FROM
My_Fact_Table

IF @Origin_Warehouse_IDs = '' AND @Ship_To_Geo_IDs = '' AND @Customer_Type_IDs = ''
BEGIN
SELECT * FROM #MyCoreTemp
END
ELSE
IF @Origin_Warehouse_IDs != '' AND @Ship_To_Geo_IDs = '' AND @Customer_Type_IDs = ''
BEGIN
SELECT * FROM #MyCoreTemp MCT
JOIN udfSplit(@Origin_Warehouse_IDs,DEFALUT) OW ON (MCT.Origin_Warehouse_ID = OW.nstr)
END
ELSE
IF @Origin_Warehouse_IDs != '' AND @Ship_To_Geo_IDs != '' AND @Customer_Type_IDs = ''
BEGIN
SELECT * FROM #MyCoreTemp MCT
JOIN udfSplit(@Origin_Warehouse_IDs,DEFALUT) OW ON (MCT.Origin_Warehouse_ID = OW.nstr)
JOIN udfSplit(@Ship_To_Geo_IDs,DEFALUT) STG ON (MCT.Ship_To_Geo_ID = STG.nstr)
END
ELSE
IF @Origin_Warehouse_IDs = '' AND @Ship_To_Geo_IDs != '' AND @Customer_Type_IDs != ''
BEGIN
SELECT * FROM #MyCoreTemp MCT
JOIN udfSplit(@Ship_To_Geo_IDs,DEFALUT) STG ON (MCT.Ship_To_Geo_ID = STG.nstr)
JOIN udfSplit(@Customer_Type_IDs,DEFALUT) CT ON (MCT.Customer_Type_ID = CT.nstr)
END
ELSE
IF @Origin_Warehouse_IDs != '' AND @Ship_To_Geo_IDs = '' AND @Customer_Type_IDs != ''
BEGIN
SELECT * FROM #MyCoreTemp MCT
JOIN udfSplit(@Origin_Warehouse_IDs,DEFALUT) OW ON (MCT.Origin_Warehouse_ID = OW.nstr)
JOIN udfSplit(@Customer_Type_IDs,DEFALUT) CT ON (MCT.Customer_Type_ID = CT.nstr)
END
ELSE
IF @Origin_Warehouse_IDs = '' AND @Ship_To_Geo_IDs = '' AND @Customer_Type_IDs != ''
BEGIN
SELECT * FROM #MyCoreTemp MCT
JOIN udfSplit(@Customer_Type_IDs,DEFALUT) CT ON (MCT.Customer_Type_ID = CT.nstr)
END
ELSE
IF @Origin_Warehouse_IDs = '' AND @Ship_To_Geo_IDs != '' AND @Customer_Type_IDs = ''
BEGIN
SELECT * FROM #MyCoreTemp MCT
JOIN udfSplit(@Ship_To_Geo_IDs,DEFALUT) STG ON (MCT.Ship_To_Geo_ID = STG.nstr)
END
ELSE
BEGIN
SELECT * FROM #MyCoreTemp MCT
JOIN udfSplit(@Origin_Warehouse_IDs,DEFALUT) OW ON (MCT.Origin_Warehouse_ID = OW.nstr)
JOIN udfSplit(@Ship_To_Geo_IDs,DEFALUT) STG ON (MCT.Ship_To_Geo_ID = STG.nstr)
JOIN udfSplit(@Customer_Type_IDs,DEFALUT) CT ON (MCT.Customer_Type_ID = CT.nstr)
END



END


----------------------------------------------------------------------------------------------------------------------------------------------------------------------------

As you can see by scenario 3 where there are only 3 multi-select lists it gets really hairy. If I go to a forth it will be even worse. Does anyone know of another better way to do this?


Thanks a bunch in advance!
Letni

View 4 Replies View Related

Multi-Value: Select All By Default

Jan 23, 2008

Hello,

Today I was creating a report with a multi-value parameter.
Someone asked me if it was possible to select all by default.
So can someone tell me how to check "Select All" by default?
Found some topics which said to set "Default Values" to "From Query" and use the same query, but that didn't work for me.

Thanks,
Rens

View 4 Replies View Related

Insert With Union All Vs Multi Select

May 21, 2008

if there are 2 insert statement

insert ... select * from table1 union all select * from table2
or
insert ... select * from table1
insert ... select * from table2

pls advise which 1 is faster ...

View 14 Replies View Related

Multi-select Dropdownlist With Checkboxes

Feb 12, 2007

When creating a windows forms report (rdl), multi-value parameters are rendered with a nice drop down list with check boxes...including a (Select All) item. When you run this via a report server and render the report for the web, the multi-value selection shows up nicely.

Can I create a similar web form dropdownlist so I can duplicate the functionality with an RDLC report?

Jim

View 3 Replies View Related

Multi Select Type-in Parameter

Nov 22, 2006

Hi All

Can anyone tell me whether or not it is
possible to multi select when you have a parameter
that is set as non-querried in order for it to be
typed instead of selected.

My users prefer typing the values and selecting
more than one. But at the moment I cant give them both..

I'm using SSRS with SSAS cube all in BI all 2005

Please help. I suspect that if it's possible it may just be a
syntax thing but I am yet to find it.

Thanks in advance

Gerhard Davids

View 5 Replies View Related

Select Values From Multi-value Parameter

Oct 16, 2006

Is it possible to pass values from UI to a multi-value parameter in a report and from this report, select values from this multi-value parameter to finally display data?

Thanks!

View 5 Replies View Related

Multi Select Parameter Problem

May 17, 2007

I have a multi-select parameter for a report, but If I select more than one value the report does not return any data. However, if only one value is selected data for that value is returned. I am using the IN option for the SP parameter.



SELECT Code,Description FROM Product

WHERE Code > 0 AND Description IN (@Description)
I am using SP2 on SQL2005, also I do not have the option of Select-All which I expected to be present.
Any help would be most appreiated.

Thanks

JohnJames

View 3 Replies View Related

Select All As Default For A Multi-value Parameter

Feb 22, 2007

Hi!

I have the following problem:

In my report I have -among others- a multi-value parameter, populated by a query (so I cannot a priori know the content of the list).

I would like my report to start without any user choice, through default parameters, so what I need is the "select all" choice selected by default. How can I achieve this?

[The only default value I am able to pass to the multi-value parameter is one of the elements populating the list, statically writing it in the "Non-queried" section of "Default values": "From query" option seems not to work for multi-valued]

Any help will be greatly appreciated!

Thanks

Stefano

View 7 Replies View Related

Help, MDX Help, Multi-select Properties Filter

Nov 23, 2007

Dear experts,

I would like to ask for a help regarding MDX query.

I am developing reports in SSRS 2005 that use some multi-valued parameters.
I need to filter out my data according to the dimension's properties' value

For example, if I have only single value parameters, I would do:

SET [SelectedDestination] AS FILTER( [Country].[Destination].Members, [Country].CurrentMember.Properties("KEY") = Parameters!Country.Value)


However, I have no idea how to handle it if Parameters!Country is a multi-valued parameter.

Is there a better method to do this? Would anybody please kindly give a direction? it will be greatly appreciated!! any help will do..


Thank you very much

View 11 Replies View Related

Multi Value Select Doesn't Work

Jan 31, 2008

My report runs from a stored proc, which gets the user to input a project id and a status. So the where statement in my stored proc looks like this:


Where (p.project LIKE @project_ID + '%' AND p.status IN(@Active))

On my report, I have set the @Active parameter to multi-value, and entered the available values(active and inactive). When I run the report, and only select one of the values, the report runs just fine, but when I use the "select all" option, I get no results at all.

I can't see where I am going wrong. Anyone got any ideas?

Thanks in advance!

View 4 Replies View Related

Multi-select Drop Down Width

Feb 25, 2008



Hi,
Has the inability to change the width of the multi-select drop down for parameters been fixed yet? Even if I could at least make it default to be wider would be great.
Thanks.

View 1 Replies View Related

Multi Parameter Select Query

Apr 4, 2007

Hi All,



I have a procdeure as written below.

I have created datasets in te report and in Report parameters clicked the Multi-value Parameter option.



When I run the report, I get all the customer names, when I select one customer report returns correct data. When I select two customers in the list box, the result set is empty. Can anyone guide me on what the error could be?



Thanks

Josh



Procedure:



create procedure MyMultiReport @customername nvarchar(30), @businessplantype nvarchar(30), @businessplanyear nvarchar(10) as
Select PlanDatameta.sort,sysperiod.id,Planmeta.id,Planmonthlydata.Productmainpkey,Country, BusinessDivisiondescription, PlanSegmentPkey, Plantext.referencepkey, Plantext.usage, sheet, name, Plantext.text, Brand, Size, text1, PlanDatameta.sort+' '+Plantext1.text as LineDescription,line, Month1, Month2, Month3, Month4, Month5, Month6, Month7, Month8, Month9, Month10, Month11, Month12, Total from Planmonthlydata join Plantext on Plantext.referencepkey=Planmonthlydata.Plansegmentpkey join PlanDatameta on PlanDatameta.pkey=Planmonthlydata.PlanDatametapkey join Productdescription on Productdescription.Productmainpkey=Planmonthlydata.Productmainpkey join Productmain on Productdescription.Productmainpkey=Productmain.pkey join Plansegment on Plansegment.pkey=Planmonthlydata.Plansegmentpkey join bpamain on bpamain.pkey=Plansegment.bpamainpkey join sysperiod on sysperiod.pkey=Plansegment.sysperiodpkey join Planmeta on Planmeta.pkey=Plansegment.Planmetapkey join Plantext Plantext1 on PlanDatameta.pkey=Plantext1.referencepkey where Planmonthlydata.status<>'d' and (PlanDatameta.sheet='PlanProductSummary') and Plantext.text<>'' and (PlanDatameta.line='MyPlanBaselineVolumeBasic' or PlanDatameta.line='BaselineVolumes' or PlanDatameta.line='IncrementalVolumes'or PlanDatameta.line='TotalVolumes') and name in (@customername) order by PlanDatameta.sort,Plantext.text,text1return

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved