Unable to find data source for query

Alc

Registered User.
Local time
Today, 13:26
Joined
Mar 23, 2007
Messages
2,421
The following query is in a database I'm working on
Code:
 WITH PROVINCES (Code, Province) AS (VALUES ('01', 'BC'), ('02', 'ALTA'), ('03', 'SASK'), ('04','MAN'), ('05','ONT'), ('06','QUE'), ('07','NB'), ('08','NS'), ('09','PEI'), ('10','NFLD'), ('11', 'YUK'), ('12','NWT'), ('13','WHOLESALE')), SALESRETAIL (Code, Sales) AS 
 (SELECT PROVINCE_SORT_CODE As Code, Sum(QUANTITY) AS Sales 
 From IWH.BASIC_UNIT_SUMMARY_FACT 
 WHERE ( IWH.BASIC_UNIT_SUMMARY_FACT.VIN_PREFIX Like 'SABA%' ) 
 AND PROVINCE_SORT_CODE <> '13' 
 AND (PRODUCT_LINE_CODE = 'M' OR PRODUCT_LINE_CODE = 'P') 
 GROUP BY ROLLUP(PROVINCE_SORT_CODE)) 
 SELECT PROVINCES.Province, SALESRETAIL.Sales From PROVINCES RIGHT JOIN SALESRETAIL ON PROVINCES.Code = SALESRETAIL.Code
The value 'SABA' comes from a field on a form.

This query runs but I've been asked to make some changes to it.

The problem I have is that IWH.BASIC_UNIT_SUMMARY_FACT or IWH_BASIC_UNIT_SUMMARY_FACT doesn't exist as either a table or a query in the database (including all hidden objects). I've previously only worked with queries and tables as places from which to pull data, so this one is puzzling for me.

What kind of data source could this be and how can I look at it directly?
 
If I had to guess, that's a pass through query? Those likely exist in whatever engine that is being passed to (SQL Server, Oracle, etc).
 
Thanks for that. I had to Google the term as I hadn't come across it before.

Think I'll look at one of the other issues until the db creator is back in work on Thursday (luckily, no shortage of things to do).
 
No problem. If it is a pass through, there would be a little globe icon next to it in the navigation pane, rather than the usual icon, which to me looks like one form on top of another. You can make a copy of it and try to modify it, but you have to use the SQL of the back end, not Access SQL.
 

Users who are viewing this thread

Back
Top Bottom