CROSS TAB Query #name? error

RandyWatson

New member
Local time
Today, 13:33
Joined
Mar 20, 2017
Messages
5
Hello everyone,

I have a crosstab query within an employee attendance tracker. The query is displaying #name? errors in some of the columns. Is their a way to fix remove the errors and still keep the column?

I have attached screenshots ot the Design View and Display View of the query. Any ideas are GREATLY appreciated. Please keep in mind that I am worse than a novice in sql. Thanks!

CrossTab.png

query.jpg

SQL:
PARAMETERS [ Supervisor: LastName_FirstInitial] Text ( 255 );
TRANSFORM Count([tbl_Attendance Tracker New].Date) AS CountOfDate
SELECT tbl_emplinfo1.EMP_CLASS_1_DESCR, [tbl_Attendance Tracker New].AGENT
FROM tbl_emplinfo1 INNER JOIN [tbl_Attendance Tracker New] ON tbl_emplinfo1.EMP_SHORT_NAME = [tbl_Attendance Tracker New].AGENT
WHERE (((tbl_emplinfo1.EMP_CLASS_1_DESCR)=[ Supervisor: LastName_FirstInitial]) AND (([tbl_Attendance Tracker New].DATE)>Date()-90))
GROUP BY tbl_emplinfo1.EMP_CLASS_1_DESCR, [tbl_Attendance Tracker New].AGENT, tbl_emplinfo1.EMP_EFF_HIRE_DATE
PIVOT [tbl_Attendance Tracker New].[ABSENCE PATTERN];
 
Last edited:
it may be because you are using a reserved word as a field name (Date). Put it in square brackets, that might solve the problem, otherwise change the field name to something more meaningful such as AttendanceDate.

You also have an initial space in your parameter and it is using a non alphanumeric character - :, both of which can cause problems - in query design the : is used to alias a column and you should not have initial or trailing spaces in names.
 
Problem solved! Thank you for the help!
 
so was it all of them, some of them or something else? Advising the solution helps others
 

Users who are viewing this thread

Back
Top Bottom