Hi there
I need to group some data in my MS Query so that they are not repeated. I have tried the GROUP BY name,address function but MS Query tells me that I cannot do this.
The query outputs e.g. the following:-
Name, Address, Tel Number, Date, User, Notes
Name, Address, Tel Number, Date, User, Notes
Name, Address, Tel Number, Date, User, Notes
Name, Address, Tel Number, Date, User, Notes
Name, Address, Tel Number, Date, User, Notes
Name, Address, Tel Number, Date, User, Notes
The Name, Address & Tel Number data is the same each time, and only the Date, User and Notes fields change. I would like to show the data where only the Name, Address and Tel Numbers appears on the first row.
My SQL so far is:-
SELECT organisations.name, addresses.address, addresses.town, addresses.county, addresses.postcode, communications.std_code, communications.number, organisation_categories_1.activity_value, contacts.title, contacts.forenames, contacts.surname, contact_positions.position, contact_roles.role, communications_log.dated, communications_log.created_by, communications_log.precis, organisations.status
FROM bmf.dbo.addresses addresses, bmf.dbo.communications communications, bmf.dbo.communications_log communications_log, bmf.dbo.contact_positions contact_positions, bmf.dbo.contact_roles contact_roles, bmf.dbo.contacts contacts, bmf.dbo.organisation_categories organisation_categories_1, bmf.dbo.organisations organisations
WHERE organisations.address_number = addresses.address_number AND organisation_categories_1.organisation_number = organisations.organisation_number AND contacts.contact_number = organisations.contact_number AND contact_positions.contact_number = contacts.contact_number AND contact_positions.organisation_number = organisations.organisation_number AND contact_roles.contact_number = contacts.contact_number AND contact_roles.organisation_number = organisations.organisation_number AND communications.address_number = organisations.address_number AND communications_log.address_number = organisations.address_number AND ((organisation_categories_1.activity='AREA') AND (contact_roles.role='GEN') AND (communications.device='TE') AND (organisations.status In ('POT','POTD','POTZ','POTS','POTR')))
ORDER BY organisations.status, organisations.name, communications_log.dated
Any help would be much appreciated!
Thanks,
Jon
![]()
Bookmarks