I'm trying to create a query from two tables.
The first table is 'Document Type' and the second one 'Document' Document Type is, if you like a category, and 'Document' contains details about the document itself. They are related (ie 'Document' contains a field which relates to the key field of 'Document Type').
Simplified, the tables look like this:-
Document Type
=============
TypeID
TypeName
TypeDescription
Document
========
DocumentID
DocumentType (fk of TypeID)
DocumentRequired
The query I'm running takes a DISTINCT list of Document types - this is the first and easiest bit.
What I'm wanting to do is to add a column to the query which then looks under 'Document' and, if there have ever been any related documents where 'DocumentRequired' is equal to TRUE, displays a TRUE/Yes value. If not, show FALSE/No.
I've tried creating a join but obviously if there are any categories which contain both required/non-required documents I get duplication. All I want is a yes/no flag.
Can somebody help?