P
papa jonah
I have a query that works with one problem, the query searches tables
that have a relationship with the orps data table. a couple of the
tables have many entries for each of the records in the orps data
table. As a result, I get several repeats of data from the orps data
table, when I only want it listed once - regardless of the number of
reason are listed.
I thought select distinct took care of that but apparently not.
SELECT DISTINCT [ORPS Data].Discovery_Date, [Zlookup: Type].Type,
[Zlookup: Reason].Reason, [Zlookup: SubReason].SubReason
FROM [Zlookup: Type] INNER JOIN ([Zlookup: Subtype] INNER JOIN
([Zlookup: SubReason] INNER JOIN ([Zlookup: Reason] INNER JOIN ((([ORPS
Data] INNER JOIN QryDivision ON [ORPS Data].[ORPS Designator] =
QryDivision.[ORPS Designator]) INNER JOIN TblTypeSubType ON [ORPS
Data].[ORPS Designator] = TblTypeSubType.[ORPS Designator]) INNER JOIN
TblReasonSubReason ON [ORPS Data].[ORPS Designator] =
TblReasonSubReason.[ORPS Designator]) ON [Zlookup: Reason].ReasonID =
TblReasonSubReason.Reason) ON [Zlookup: SubReason].SubReasonID =
TblReasonSubReason.SubReason) ON [Zlookup: Subtype].SubtypeID =
TblTypeSubType.idSubtype) ON [Zlookup: Type].TypeID =
TblTypeSubType.Type
WHERE ((([Zlookup: Type].Type) Like "*" & [Forms]![query
form]![txttopicinput] & "*")) OR ((([Zlookup: Reason].Reason) Like "*"
& [Forms]![query form]![txttopicinput] & "*")) OR ((([Zlookup:
SubReason].SubReason) Like "*" & [Forms]![query form]![txttopicinput] &
"*"))
ORDER BY [ORPS Data].Discovery_Date;
that have a relationship with the orps data table. a couple of the
tables have many entries for each of the records in the orps data
table. As a result, I get several repeats of data from the orps data
table, when I only want it listed once - regardless of the number of
reason are listed.
I thought select distinct took care of that but apparently not.
SELECT DISTINCT [ORPS Data].Discovery_Date, [Zlookup: Type].Type,
[Zlookup: Reason].Reason, [Zlookup: SubReason].SubReason
FROM [Zlookup: Type] INNER JOIN ([Zlookup: Subtype] INNER JOIN
([Zlookup: SubReason] INNER JOIN ([Zlookup: Reason] INNER JOIN ((([ORPS
Data] INNER JOIN QryDivision ON [ORPS Data].[ORPS Designator] =
QryDivision.[ORPS Designator]) INNER JOIN TblTypeSubType ON [ORPS
Data].[ORPS Designator] = TblTypeSubType.[ORPS Designator]) INNER JOIN
TblReasonSubReason ON [ORPS Data].[ORPS Designator] =
TblReasonSubReason.[ORPS Designator]) ON [Zlookup: Reason].ReasonID =
TblReasonSubReason.Reason) ON [Zlookup: SubReason].SubReasonID =
TblReasonSubReason.SubReason) ON [Zlookup: Subtype].SubtypeID =
TblTypeSubType.idSubtype) ON [Zlookup: Type].TypeID =
TblTypeSubType.Type
WHERE ((([Zlookup: Type].Type) Like "*" & [Forms]![query
form]![txttopicinput] & "*")) OR ((([Zlookup: Reason].Reason) Like "*"
& [Forms]![query form]![txttopicinput] & "*")) OR ((([Zlookup:
SubReason].SubReason) Like "*" & [Forms]![query form]![txttopicinput] &
"*"))
ORDER BY [ORPS Data].Discovery_Date;