The code looks like this:
The table Landundertake structure looks like this:
The table appraiser structure looks like this:
Access code:
Copy Code code as follows:
TRANSFORM A (Landundertake.valuerid) as Valuerid
SELECT Appraiser.quarterid, Landundertake.landcode
From Landundertake INNER JOIN appraiser on (landundertake. Valuerid = Appraiser.valuerid) and (landundertake. Quarterid = Appraiser.quarterid)
GROUP by Appraiser.quarterid, Landundertake. Landcode
PIVOT Landundertake. Valuergrade;
SQL Server Code:
Copy Code code as follows:
Select Dbo.appraiser.quarterid,dbo.landundertake.landcode,case Dbo.landUndertake.appraiserGrade when ' AppraiserID1 ' then Dbo.landundertake.appraiserID else null end as Appraiserid,case dbo.landUndertake.appraiserGrade When ' appraiserID2 ' then Dbo.landundertake.appraiserID else null end as AppraiserID1
FROM dbo. Landundertake INNER JOIN
Dbo. Appraiser on dbo. Landundertake.quarterid=dbo.appraiser.quarterid and Dbo.landundertake.appraiserid=dbo. Appraiser.appraiserid
Group by Dbo.appraiser.quarterid,dbo.landundertake.landcode,dbo.landundertake.appraisergrade, Dbo.landundertake.appraiserID
The crosstab query results are as follows: