Query changes field name to Expr1000

G

Guest

I am running a query where one of the fields I'm trying to print is called
EmpNum. When I run the query, the resulting field name is changed to
Expr1000. Can anyone tell me what is wrong with this query? I have looked
in the posts and am not finding any hits. Thanks for your help. Here is the
SQL of my query. The field in question is the very first one:

SELECT [e-BizProjectVendorTaskValidation2].EmpNum,
[e-BizProjectVendorTaskValidation2].Employee,
[e-BizProjectVendorTaskValidation2].PPEdate,
[e-BizProjectVendorTaskValidation2].HourType,
[e-BizProjectVendorTaskValidation2].NightHours,
[e-BizProjectVendorTaskValidation2].Revision,
[e-BizProjectVendorTaskValidation2].TotalHours,
[e-BizProjectVendorTaskValidation2].Project,
[e-BizProjectVendorTaskValidation2].Vendor,
[e-BizProjectVendorTaskValidation2].Function,
[e-BizProjectVendorTaskValidation2].Task,
[e-BizProjectVendorTaskValidation2].ProjectVendorTask,
[e-BizProjectVendorTaskValidation2].EmpProjVendTask,
[e-BizProjectVendorTaskValidation2.HourType] &
[e-BizProjectVendorTaskValidation2.Function] &
[e-BizProjectVendorTaskValidation2.Task] AS HrTpFunctTask,
HourTypeCodes.Category, [e-BizProjectVendorTaskValidation2].EmpNum
FROM ([e-BizProjectVendorTaskValidation2] LEFT JOIN
ValidProjectVendorTaskByScheduler ON
[e-BizProjectVendorTaskValidation2].EmpProjVendTask =
ValidProjectVendorTaskByScheduler.EmpProjtVendTask) LEFT JOIN HourTypeCodes
ON [e-BizProjectVendorTaskValidation2].HourType = HourTypeCodes.HourType
WHERE (((ValidProjectVendorTaskByScheduler.EmpProjtVendTask) Is Null)) OR
((([e-BizProjectVendorTaskValidation2].Function) Like "gl*") AND
((HourTypeCodes.Category)="work")) OR
((([e-BizProjectVendorTaskValidation2].Task) Like "gl*") AND
((HourTypeCodes.Category)="work"))
ORDER BY [e-BizProjectVendorTaskValidation2].Employee,
[e-BizProjectVendorTaskValidation2].PPEdate,
[e-BizProjectVendorTaskValidation2].HourType;
 
G

Guest

And the very last one also. You have it listed twice in the SELECT section:
just after the word SELECT and again just before the word FROM.

You can't return the same field name twice so Access creates a name like
Expr1000 so that the query can run.
 
G

Guest

Thanks! My resulting table was wider than my display and I didn't scroll far
enough over to see that I'd already selected the Employee Number. Sorry to
ask such a silly question.
--
Ann Scharpf


Jerry Whittle said:
And the very last one also. You have it listed twice in the SELECT section:
just after the word SELECT and again just before the word FROM.

You can't return the same field name twice so Access creates a name like
Expr1000 so that the query can run.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

Ann Scharpf said:
I am running a query where one of the fields I'm trying to print is called
EmpNum. When I run the query, the resulting field name is changed to
Expr1000. Can anyone tell me what is wrong with this query? I have looked
in the posts and am not finding any hits. Thanks for your help. Here is the
SQL of my query. The field in question is the very first one:

SELECT [e-BizProjectVendorTaskValidation2].EmpNum,
[e-BizProjectVendorTaskValidation2].Employee,
[e-BizProjectVendorTaskValidation2].PPEdate,
[e-BizProjectVendorTaskValidation2].HourType,
[e-BizProjectVendorTaskValidation2].NightHours,
[e-BizProjectVendorTaskValidation2].Revision,
[e-BizProjectVendorTaskValidation2].TotalHours,
[e-BizProjectVendorTaskValidation2].Project,
[e-BizProjectVendorTaskValidation2].Vendor,
[e-BizProjectVendorTaskValidation2].Function,
[e-BizProjectVendorTaskValidation2].Task,
[e-BizProjectVendorTaskValidation2].ProjectVendorTask,
[e-BizProjectVendorTaskValidation2].EmpProjVendTask,
[e-BizProjectVendorTaskValidation2.HourType] &
[e-BizProjectVendorTaskValidation2.Function] &
[e-BizProjectVendorTaskValidation2.Task] AS HrTpFunctTask,
HourTypeCodes.Category, [e-BizProjectVendorTaskValidation2].EmpNum
FROM ([e-BizProjectVendorTaskValidation2] LEFT JOIN
ValidProjectVendorTaskByScheduler ON
[e-BizProjectVendorTaskValidation2].EmpProjVendTask =
ValidProjectVendorTaskByScheduler.EmpProjtVendTask) LEFT JOIN HourTypeCodes
ON [e-BizProjectVendorTaskValidation2].HourType = HourTypeCodes.HourType
WHERE (((ValidProjectVendorTaskByScheduler.EmpProjtVendTask) Is Null)) OR
((([e-BizProjectVendorTaskValidation2].Function) Like "gl*") AND
((HourTypeCodes.Category)="work")) OR
((([e-BizProjectVendorTaskValidation2].Task) Like "gl*") AND
((HourTypeCodes.Category)="work"))
ORDER BY [e-BizProjectVendorTaskValidation2].Employee,
[e-BizProjectVendorTaskValidation2].PPEdate,
[e-BizProjectVendorTaskValidation2].HourType;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top