John Spencer replied to TWYSTD
22-Nov-09 03:33 PM

Looks like it could be an incorrect error message. It should be complaining
about duplicate fields.
Another possible problem (less likely) is aliasing Outage.[WO-Number] AS
[WO-Number] when you also have [Current Comments].[WO-Number].
SELECT Outage.WORK_ORDER_NBR
, Outage.WORK_ORDER_TASK
, Outage.WO_TSK_STATUS_DATE
, Outage.SYSTEM_CODE
, Outage.DISCIPLINE
, Outage.WO_TSK_STATUS
, Outage.[WO-Number] AS [WO-Number]
, Outage.WORK_ORDER_TYPE
, Outage.WR_TASK_TITLE
, Outage.WO_TSK_PLANNER
, [All-current-holds].[Hold Code] AS HOLDS
, Ecr.[Ec Request Nbr] AS [ECR #]
, Ecr.[Title 195] AS [ECR TITLE]
, Ecs.[Ec Number] AS [EC#]
, Ecs.[Ec Status Desc] AS [EC STATUS]
, Ecs.[Title 196] AS [EC TITLE]
, [Current Comments].[COMMENTS nsed]
, [Current Comments].[COMMENTS parts]
, [Parts hold].MATERIAL_REQUEST
, "" AS [Date-PE]
, * <<<<<<<<<<<<< This (all fields] would create DUPLICATE FIELDS
INTO [STATUS UPDATE]
FROM [Current Comments] RIGHT JOIN (Ecr RIGHT JOIN (((Outage LEFT JOIN
[All-current-holds] ON Outage.[WO-Number] = [All-current-holds].[WO Number])
LEFT JOIN Ecs ON Outage.[WO-Number] = Ecs.[WO Number]) LEFT JOIN [Parts hold]
ON Outage.[WO-Number] = [Parts hold].[WO Number]) ON Ecr.[WO Number] =
Outage.[WO-Number]) ON [Current Comments].[WO-Number] = Outage.[WO-Number]
ORDER BY Outage.DISCIPLINE, Outage.WO_TSK_STATUS, Outage.[WO-Number]
WITH OWNERACCESS OPTION;
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County