It's not as easy as it may seem. You might be able to make use of the query that I use to associate Activity Attachments with the organization that created the attachment. This is a DB2 query but is readily ported to any other engine:

Copyright 1998-2015 Ziff Davis, LLC (Toolbox.com). All rights reserved. All product names are trademarks of their respective companies. Toolbox.com is not
affiliated with or endorsed by any company listed at this site.