Getting Data X based on variables

C

CBelcher

I have two tables, one is a list of transactions that have taken place over a
wide group of offices and the other is a list of offices and the locations
them that the transactions refer to.

In the transactions table I have among other data [Office] (6 digit number
where 1st 3 digits are the area and the next 3 digits are the office), [CA]
(text), ), Pr (integer).
In the Offices Table I have [WC](same as office in the transaction table),
[CA] (txt)[Lpr] (integer), [Hpr] (integer), [Sys] (integer).
[Sys] is the name of a system that feeds a cable that is unique to that
office that is made up of a range of pairs [pr]). The [CA] name is neither
unique to that office or within that office but there will only be one
instance of that CA&pr within that office. For instance, you could have a
[ca]f642 and [pr]2320 in two different offices but not within the office. The
system number is unique within the office but not across offices.

What I'm looking to do is to return the system number [sys] from office where
the pair [pr] in the transaction table is => [Lpr] and
=<[Hpr],[wc]=[office], and [ca] is equal in both tables. Once I have the
system number I will use it for analysis.

There are 26 offices (static), hundreds of systems(variable but with only
single digit changes per month), 10s of thousands transactions 8-9k
transactions per month.

Any guidance would be appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top