I am trying to convert this into SQL form -
TRANSFORM count(tblinserts.clientid) AS SumOfHomes
SELECT tblInserts.SalesRep, tblstaff.firstname, tblstaff.lastname
FROM tblInserts, tblstaff
WHERE tblinserts.inserttype<>'W' and tblinserts.salesrep=tblstaff.repid
GROUP BY tblInserts.SalesRep, tblstaff.lastname, tblstaff.firstname
PIVOT Format([ProductionDate],"mmm") In ("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
The reason why I need to do this is because I need to beable to get a distinct count off the clientid I am counting.
Any help would be appreciated.
TRANSFORM count(tblinserts.clientid) AS SumOfHomes
SELECT tblInserts.SalesRep, tblstaff.firstname, tblstaff.lastname
FROM tblInserts, tblstaff
WHERE tblinserts.inserttype<>'W' and tblinserts.salesrep=tblstaff.repid
GROUP BY tblInserts.SalesRep, tblstaff.lastname, tblstaff.firstname
PIVOT Format([ProductionDate],"mmm") In ("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
The reason why I need to do this is because I need to beable to get a distinct count off the clientid I am counting.
Any help would be appreciated.