Select item characteristic to pull the correct pricing

The goal is to show an inventory report where our raw materials pull from a cost dataset, but the finished goods pull from the pricing dataset.  I have been trying to say that if the itemclass is anything other than F (for Finished Goods) then use the FGPrice dataset field Price for the value, otherwise use InventorySet dataset field TotCost for the value.  I just can't get it to do that.  HELP! :-)

One dataset is for the cost with this query -
SELECT        ItemNumber, ItemDescription, qtysum, Val, ItemClass4, CostType, TotalRolledCost
FROM            Mcc_InventoryDailyDetail
ORDER BY ItemClass4, ItemNumber

The other dataset is for the pricing with this query -
SELECT DISTINCT MAX(InvoiceDate) AS InvDate, LineItemNumber, MAX(InvoiceLocalUnitPrice) AS Price
FROM         dbo.MCC_vwSalesTotalsWithInvoices
GROUP BY LineItemNumber
HAVING      (LineItemNumber <> 'FREIGHT')
oRDER BY LineItemNumber
tgfo4927Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TempDBACommented:
You can't associate a single object with multiple dataset. The mapping is one to one.
0
ValentinoVBI ConsultantCommented:
I have the impression that something in your logic is missing.  How are you matching the items?  Using the ItemNumber?  So you'd have each ItemNumber in both datasets?

As TempDBA said: you can only bind one dataset to a tablix.  Unless you can somehow get all your data in one query, perhaps the new lookup functions can help you out?  Check out the following article on how to use them: http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/MS-SQL_Reporting/A_3433-Looking-Up-Data-On-Different-Sources.html
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tgfo4927Author Commented:
this provided some good insight into the lookup feature
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
SSRS

From novice to tech pro — start learning today.