SQL for counting tasks by employee over different days (1 Viewer)

Uncle Ned

Registered User.
Local time
Today, 01:53
Joined
Sep 26, 2019
Messages
45
Guys/Girls,

I’m looking for some help with SQL for a query in Access 2016. I have department with different employees recording a task on access every time they fit a component on the factory floor, the data is simply their name and the date that they completed the task.

Table: tblProductBladeInfo
Field1: FittedBy
Field2: FittedDate

What I’m trying to get from my query is the following

Employee | 14-Jan | 12-Jan | 11-Jan | 10-Jan | 9-Jan |
----------|--------|-------|-------|--------|--------|
Paul -----|---4----|---5---|---5---|---4----|---6----|
----------|--------|-------|-------|--------|--------|
Dave ----|---2----|---3---|---0---|---3----|---7----|
----------|--------|-------|-------|--------|--------|
Mike -----|---7----|---6---|---8---|---2----|---0----|


I can easily get the first two columns with the following

SELECT tblProductBladeInfo.FittedBy, Count(tblProductBladeInfo.FittingDate) AS CountOfFittingDate
FROM tblProductBladeInfo
WHERE (((tblProductBladeInfo.FittingDate)=Date()-1))
GROUP BY tblProductBladeInfo.FittedBy
ORDER BY tblProductBladeInfo.FittedBy DESC;


But to get the extra date columns, and have the Title in the column change each day is a step too far for me.

Any help is greatly appreciated
 

Uncle Ned

Registered User.
Local time
Today, 01:53
Joined
Sep 26, 2019
Messages
45
That works - thanks
 

Users who are viewing this thread

Top Bottom