Create a Pass-through Query and connect it to the proper DSN.
enter the sql script, save it as DBA
SELECT
BKARHINV.BKAR_INV_CUSCOD,
BKARHINV.BKAR_INV_CUSNME,
Year(BKAR_INV_INVDTE) AS SYEAR,
IF(Year(BKAR_INV_INVDTE)= 2008,BKAR_INV_SUBTOT,'0') "T2008",
IF(Year(BKAR_INV_INVDTE)= 2007,BKAR_INV_SUBTOT,'0') "T2007",
IF(Year(BKAR_INV_INVDTE)= 2006,BKAR_INV_SUBTOT,'0') "T2006",
IF(Year(BKAR_INV_INVDTE)= 2005,BKAR_INV_SUBTOT,'0') "T2005",
IF(Year(BKAR_INV_INVDTE)= 2004,BKAR_INV_SUBTOT,'0') "T2004",
IF(Year(BKAR_INV_INVDTE)= 2003,BKAR_INV_SUBTOT,'0') "T2003"
FROM BKARHINV
ORDER BY BKAR_INV_CUSCOD
Create a Regular query (Query1) and enter the following sql:
SELECT DBA.* INTO Temp
FROM DBA;
Create a Regular query (Query2) and enter the followin sql:
SELECT
Temp.BKAR_INV_CUSCOD,
Temp.BKAR_INV_CUSNME,
Sum(Temp.T2008) AS 2008,
Sum(Temp.T2007) AS 2007,
Sum(Temp.T2006) AS 2006,
Sum(Temp.T2005) AS 2005,
Sum(Temp.T2004) AS 2004,
Sum(Temp.T2003) AS 2003
INTO MAIN
FROM Temp
GROUP BY Temp.BKAR_INV_CUSCOD, Temp.BKAR_INV_CUSNME;
Open/Run Query1, then Query2
You will have a table called "MAIN"