View Full Version : please help!!!


choti
10-08-2001, 11:59 AM
in my db i have a restaurant table which has fields such as name, street, town, postcode etc. there is another table (contacts) which has phone, fax, email as fields. the relationship between this is 1-many. if i run a query of restaurant and contacts, the same restaurant may appear as many times as there are contacts

eg macdonalds - 020 89535522
macdonalds - 020 89654444
macdonalds - 020 86542222

how can i design my query so that the name appears once with the appropriate numbers. i am using the query for asp so do i design the query to show the correct results or is it in the asp page??

much appreciated

choti

Travis
10-08-2001, 12:16 PM
Your query is returning exactly what you asked.

which means it will return one record for each contact of the Resturante.

If you only want one number and one resturante then do a group by query, Group on the Resturante and use the FIRST for all of the other values

choti
10-09-2001, 02:23 AM
thanx but what i want is for the restaurant name appearing once but with both telephone numbers appearing...

lscheer
10-09-2001, 09:27 AM
What you need to do then is use a report (with the query as the recordsource) and adjust the grouping options to get what you want.

choti
10-09-2001, 10:09 AM
thx again but i need a query cos i am gonna use it on asps