Can you connect to QuickBooks using Mathematica DatabaseLink? If you can connect the remainder of the question is generating the SQL commands as string to get executed on database system. Something like:
SQLExecute[conn, "spreport ProfitAndLossStandard show AccountFullName, AccountListId, AccountType, RowData, RowDataType, RowType, Label, Amount1 as Amount1, Amount2, Amount3, Amount4, Amount5, Amount6"];
So first make certain you can connect using DatabaseLink: Mathematica to QuickBooks. Otherwise you are asking how to generate a this string given a range of n years will yield the string "Amount1 as Amount1, Amount2 as ..., Amountn". But with no successful connection?