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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comparsion between two different tables

Status
Not open for further replies.

makala

Technical User
Mar 13, 2003
7
US
I have two tables, one Switch table(Table Name dbo_DTS_Switch) that holds all the Switch ports I have(field Name SwitchPort), the second table (Table Name dbo_DTS_Server) holds two fields that contain the switch ports(Field Names Switchport1 and Switchport2) that have been used. What would be the code to compare the one total list to the two used lists and display the ports that are still available in a combobox(SwitchPort)on a form(Network Information)? I really love this site and you all are alot of help. Thanks for any answers and help I can get. Hope you have a wonderful weekend.
 
Select dbo_DTS_Switch.SwitchPort
From dbo_DTS_Switch
Where dbo_DTS_Switch.SwitchPort Not In
(Select dbo_DTS_Server.SwitchPort1
From dbo_DTS_Server)
And dbo_DTS_Switch.SwitchPort Not In
(Select dbo_DTS_Server.SwitchPort2
From dbo_DTS_Server)
Order By dbo_DTS_Switch.SwitchPort

Good LucK!

 
OK, The above comparsion will be based on which Switch Panel(SwitchPanel field on the Network Form on the dbo_DTS_Server Table) has been selected on the form (Network Information)in a combo box (Switch Panel).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top