gabber4858
Technical User
I have a table that I am trying to account for 4 different ways a wire connection can be made. The wires need to be "cross connected" in different locations to complete the circuit. I currently have a combo box to select the Start type, and End type of the connection and combow boxes to get the appropriate ID from the related tables. I am new to SQL queries and am looking for advice on how to set up my query.
My connection types are Jack to Pair, Pair to Port, Pair to Pair, and Jack to Port. My table looks like this:
ID start_type start_id end_type end_id
1 Jack 1 Pair 10
2 Pair 20 Pair 30
3 Pair 40 Port 50
4 Jack 2 Pair 80
5 Pair 90 Port 120
So... I want to be able to see the connection start to finish, or where there are "breaks".
I have gotten this far, but I am starting to get confused on the rest of the statement:
SELECT Jacks.JackNumber, Pairs.PairNumber
FROM Jacks, Pairs, CrossConnects
WHERE (((CrossConnects.StartType)='Jack') And ((CrossConnects.EndType)='Pair')
And ((Jacks.ID)=CrossConnects.StartID)
And ((CrossConnects.EndID)=Pairs.ID))
ORDER BY JackNumber;
I am not against scrapping this design out for a more efficient way, and any help is appreciated. Thank you in advance!!!
My connection types are Jack to Pair, Pair to Port, Pair to Pair, and Jack to Port. My table looks like this:
ID start_type start_id end_type end_id
1 Jack 1 Pair 10
2 Pair 20 Pair 30
3 Pair 40 Port 50
4 Jack 2 Pair 80
5 Pair 90 Port 120
So... I want to be able to see the connection start to finish, or where there are "breaks".
I have gotten this far, but I am starting to get confused on the rest of the statement:
SELECT Jacks.JackNumber, Pairs.PairNumber
FROM Jacks, Pairs, CrossConnects
WHERE (((CrossConnects.StartType)='Jack') And ((CrossConnects.EndType)='Pair')
And ((Jacks.ID)=CrossConnects.StartID)
And ((CrossConnects.EndID)=Pairs.ID))
ORDER BY JackNumber;
I am not against scrapping this design out for a more efficient way, and any help is appreciated. Thank you in advance!!!