I managed to write my first pivot query the other day but now I'd like to do one more thing with it. Here's the query:
There are three possible values for EmployeeTable.Function: Technician, Pharmacist, and Non-Clinical. Those three values are the first three columns. The fourth is the total of all employees and the last is the supervisor.
What I would like to do is move the Supervisor column to the left side so my managers can export this query to Excel and use a vlookup. Is there a way to do that without them having to cut/paste the column each time?
Code:
TRANSFORM Count(EmployeeTable.EmployeeId) AS CountOfEmployeeId
SELECT EmployeeTable.Supervisor, Count(EmployeeTable.EmployeeId) AS [Total Of EmployeeId]
FROM EmployeeTable
WHERE Location="Overland Park" AND Active = True
GROUP BY EmployeeTable.Supervisor
PIVOT EmployeeTable.Function;
There are three possible values for EmployeeTable.Function: Technician, Pharmacist, and Non-Clinical. Those three values are the first three columns. The fourth is the total of all employees and the last is the supervisor.
What I would like to do is move the Supervisor column to the left side so my managers can export this query to Excel and use a vlookup. Is there a way to do that without them having to cut/paste the column each time?