Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Matrix of possible combinations.

Status
Not open for further replies.

PureSlate

MIS
Oct 25, 2010
34
US
Hi, I've been given a large set of data to transform, and while I think the task would be relatively simple to complete by making a quick macro, I imagine there should be some relatively simple SQL solution for this. Despite my efforts, I have been unable to come up with a query (or set of queries) to do exactly what I want.

The basic data input/output would be as follows.
Example.JPG

(No duplicate combinations.)

I imagine that This should be able to be accomplished using some NOT IN or NOT LIKE subqueries, but I haven't been able to come up with a solution.

Does anybody have any ideas?
 
I finished the coding in VBA, and as I expected it is quite clunky and time consuming to run. Any insight is appreciated.
 
Insight into WHAT? You posted no SQL or VBA!

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
I never could quite figure out the exact logic behind this, but I did come to a working solution for my dataset.

Assumption: Each type only has two DATA types.

I then pulled the Min and Max for each Type as field B and B2, and used a subquery to pull in the objects associated with the type in B or B2.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top