malcolm.reed
Registered User.
- Local time
- Today, 20:58
- Joined
- Jan 17, 2009
- Messages
- 15
Good Afternoon,
I'm hoping someone can put me on the right track with this little problem. I've created a simple database that I've been playing around with but this is a technique I've wrestled with on real projects. I struggle to write SQL by hand, so try to use the Query Designer wherever I can (maybe that's my problem). Or it could be a basic design problem. Either way, I'm happy to take advice.
In my example, I have a form where users can pick their name from a list (names are in their own table), then choose their top2 favourite colours from two more drop down boxes. The list of colours is also in its own table but there is just one colour list used to populate both controls on the form.
What I want is a query which returns 3 columns and in this case 10 rows - the real name, colour 1 and colour 2.
e.g.
Bill, yellow, red
fred, red, green
john,indigo,yellow
and so on.
I can perfectly easily create individual queries for either colour - but not both. I won't list all the ways it's gone wrong for me but if you look at the attachment you'll see some of my failed experiments.
All (polite!) suggestions welcome - thanks!
I'm hoping someone can put me on the right track with this little problem. I've created a simple database that I've been playing around with but this is a technique I've wrestled with on real projects. I struggle to write SQL by hand, so try to use the Query Designer wherever I can (maybe that's my problem). Or it could be a basic design problem. Either way, I'm happy to take advice.
In my example, I have a form where users can pick their name from a list (names are in their own table), then choose their top2 favourite colours from two more drop down boxes. The list of colours is also in its own table but there is just one colour list used to populate both controls on the form.
What I want is a query which returns 3 columns and in this case 10 rows - the real name, colour 1 and colour 2.
e.g.
Bill, yellow, red
fred, red, green
john,indigo,yellow
and so on.
I can perfectly easily create individual queries for either colour - but not both. I won't list all the ways it's gone wrong for me but if you look at the attachment you'll see some of my failed experiments.
All (polite!) suggestions welcome - thanks!