micki_free
12-09-2009, 02:28 PM
Hi all
I have created an outer left join between tables. However the data is a bit messed up and the second table has multiple tuples that tally up with the tuples in the first table
is it possible to only display the first set of values from the second table, ensuring that each tuple in table one is only displayed once?
HiTechCoach
12-09-2009, 05:26 PM
Normally I would remove the other table and use a sub report or sub form to display the related data.
If you must have the data in the one query, then I would try using a Sub Query (click here for the basics) (http://www.allenbrowne.com/subquery-01.html).
micki_free
12-14-2009, 11:47 AM
SELECT sites_users_and_role.PUID, sites_users_and_role.PUID_Name, sites_users_and_role.Create_Date, PUID_and_UINs.UINs, Authorised_Demanders.Authorised_Demander, UIN_TLB_MG.[TLB Code], TLBNames.[TLB Name]
FROM ((sites_users_and_role LEFT JOIN (PUID_and_UINs LEFT JOIN Authorised_Demanders ON PUID_and_UINs.UINs = Authorised_Demanders.UINs) ON sites_users_and_role.PUID_Name = PUID_and_UINs.PUID_Name) LEFT JOIN UIN_TLB_MG ON PUID_and_UINs.UINs = UIN_TLB_MG.UINs) LEFT JOIN TLBNames ON PUID_and_UINs.UINs = TLBNames.UINs
ORDER BY sites_users_and_role.Service_TYPE;
basically i am concerned with this part of the join.
there are multiple Authorised_Demanders records for each PUID_and_UINs record. so instead of a single line being displayed per sites_users_and_role record i get multiple lines
i just want to display the first tuple and i want to do it in a query if possible. any ideas?