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

Returning records that are present in only one table 1

Status
Not open for further replies.

chilledproduce

Programmer
Jun 27, 2001
15
0
0
GB
Hi Guys

This is probley quite simple but I can the only solution I can come up with uses loops all over the place.

I have two tables One listing all available values and another that contains a sub-set of these values.

I'm creating a form which will work much like the query wizard in Access where you have two list boxes and can move values from one to the other by clicking the appropiate commad button.

I can fill the first list box easily enough with the sub - set but I want to fill the remaining list box with the values that are not present in the sub set.

Any help would be well appreicated.

Cheers

Phill

 
Hi!

You can use a subquery:

Select Values From TableOne Where Values Not In (Select Values From TableTwo)

hth
Jeff Bridgham
 
Hi again!

Actually another thought occurs to me. You could add a field to TableOne called Selected (or whatever else is good for you). It would be a yes/no field and if it is true then the value would appear in the second list box and if false then it would appear in the first. This would make your queries easier and you would only need to store the values in one place.

hth
Jeff Bridgham
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top