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
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