0 Replies Latest reply: Nov 19, 2014 12:35 PM by Giovanni Russo RSS

    Loading SQL Query from Access DB File

      Hi,

      I am trying to load different tables in QV from my Access DB file.

      After I loaded and selected the right tables by ODBC connection, I add final SQL query and then I receive this output with its script:

       

      SQL##f - SqlState: 07001, ErrorCode: 4294964286, ErrorMsg: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 4.

      SELECT [BOARDANAAGE_v 0 1].DTA_Competenza, [BOARDRNT_v 0 1].COD_Prodotto, [BOARDANAAGE_v 0 1].COD_FB, [BOARDANAAGE_v 0 1].NOME_FB, Sum([BOARDRNT_v 0 1].DBL_RN) AS SumOfDBL_RN, [BOARDRNT_v 0 1].DES_Comparto, [BOARDANACLI_v 0 1].F_PRIMABANCA, [BOARDANACLI_v 0 1].CLUSTER_PRIMAFILA, [BOARDANACLI_v 0 1].F_BANCARIZZATO, [BOARDANAAGE_v 0 1].PERC_PROVVIGIONALE, IIf(Left([BOARDANAAGE_v 0 1]![DATA_INGRESSO],4)="2014","1","0") AS DATA_INGRESSO, IIf(Left([BOARDANAAGE_v 0 1]![DATA_DIMISSIONI],4)="2014","1","0") AS DATA_DIMISSIONI, [BOARDANAAGE_v 0 1].STRU_SPV3LIV, [BOARDANAAGE_v 0 1].STRU_SPV4LIV, [BOARDANAAGE_v 0 1].STRU_SPV5LIV, [BOARDANACLI_v 0 1].COD_CLIENTE

      FROM (([BOARDANAAGE_v 0 1] LEFT JOIN [BOARDRNT_v 0 1] ON [BOARDANAAGE_v 0 1].DTA_Competenza = [BOARDRNT_v 0 1].DTA_Competenza) LEFT JOIN [BOARDSPE_v 0 1] ON [BOARDANAAGE_v 0 1].DTA_Competenza = [BOARDSPE_v 0 1].DTA_Competenza) LEFT JOIN [BOARDANACLI_v 0 1] ON [BOARDRNT_v 0 1].COD_Cliente = [BOARDANACLI_v 0 1].COD_CLIENTE

      WHERE ((([BOARDANAAGE_v 0 1].LIVELLO_CARRIERA)="REGIONAL") AND (([BOARDANAAGE_v 0 1].STRU_SPV2LIV)=113))

      GROUP BY [BOARDANAAGE_v 0 1].DTA_Competenza, [BOARDRNT_v 0 1].COD_Prodotto, [BOARDANAAGE_v 0 1].COD_FB, [BOARDANAAGE_v 0 1].NOME_FB, [BOARDRNT_v 0 1].DES_Comparto, [BOARDANACLI_v 0 1].F_PRIMABANCA, [BOARDANACLI_v 0 1].CLUSTER_PRIMAFILA, [BOARDANACLI_v 0 1].F_BANCARIZZATO, [BOARDANAAGE_v 0 1].PERC_PROVVIGIONALE, IIf(Left([BOARDANAAGE_v 0 1]![DATA_INGRESSO],4)="2014","1","0"), IIf(Left([BOARDANAAGE_v 0 1]![DATA_DIMISSIONI],4)="2014","1","0"), [BOARDANAAGE_v 0 1].STRU_SPV3LIV, [BOARDANAAGE_v 0 1].STRU_SPV4LIV, [BOARDANAAGE_v 0 1].STRU_SPV5LIV, [BOARDANACLI_v 0 1].COD_CLIENTE

       

       

      Please help me to sort out the error in the SQL Query

       

      Thanks in Advance