Complex query, Any help??

bsnapool

Registered User.
Local time
Today, 14:08
Joined
Nov 17, 2006
Messages
96
Hi

I have come to a dead end with my query. Any help would be really appreciated.

I have a query which i have written:

Code:
SELECT TblBurnleyWwTw.MetricID
FROM TblBurnleyWwTw
WHERE (((TblBurnleyWwTw.[Data Source])="OMS")) OR (((TblBurnleyWwTw.TAGFunction)="CHP"))
GROUP BY TblBurnleyWwTw.MetricID, TblBurnleyWwTw.[Metric Required], TblBurnleyWwTw.CALCULATIONS, TblBurnleyWwTw.PIPointSource, TblBurnleyWwTw.PILoc1, TblBurnleyWwTw.[High Level KPI]
HAVING (((TblBurnleyWwTw.MetricID) Like "130*") AND ((TblBurnleyWwTw.[Metric Required])="-1") AND ((TblBurnleyWwTw.PIPointSource)<>"L"));

This retreives all codes relating to what i want. The problem is, I need this data to try and match within another column of calculations E.g. Data retreived from query I have may be 13001, 13002, 13003. What I would like to do with this data is to lookup in a calculations column if any of the above data matches to bring back the metric ID which is realted to it?

Hope i have stated this clearly enough for anyone to understand???

As i say any help or recommednations for a solution would be really appreciated

Andrew
 
Create another query against your table, and join this query to your metricid field, then pull the data you want.
 
I have tried this but, could not relate the query to the calcualtions column? Any ideas?
 
Maybe I didn't understand.
You have this query which is returning a set of MetricID's.
So what else did you want to do with it?
 
Code:
Maybe I didn't understand.
You have this query which is returning a set of MetricID's.
So what else did you want to do with it?

OK

I created a query from a table which has over a thousand records, the query has some conditions and the query gets the records down to 13.

These 13 records are as follows: 13,001, 13002 etc etc

I would like to use this data to look up a calculations column in the table via a query. E.g. the records which are drawn through the query to look in the calculations column and if there is a match to bring back that row?

This help?

Thanks for your reply

Andrew
 
So does this 13001, 13002 etc match something in the other table?
 
Yes, within a column called calcualtions. But there may be other data in there such as 13001 * 234 etc etc
 

Users who are viewing this thread

Back
Top Bottom