Re: How do I turn some text into a variable and bind as the primary key to another table?
chiesa80thanksfor your reply.but Icould notrun thequery. the following error appears:
SQL Error:[Microsoft][Driver ODBC para Microsoft Access] Erro de sintaxe (operador faltando) na expressão de consulta 'CASE Months.MONTH WHEN 'JAN' THEN 'SomaDeACT_JAN' WHEN 'FEB' THEN 'SomaDeACT_FEB' WHEN 'MAR' THEN 'SomaDeACT_MAR' WHEN 'APR' THEN 'SomaDeACT_APR' WHEN 'MAY' THEN 'SomaDeACT_MAY' WHEN 'JUN' THEN 'SomaDeACT_JUN' WHEN 'JUL' THEN 'SomaDeACT_JUL' '.
how do Ifix?
ODBCCONNECTTO[Banco de dados do MS Access; DBQ=Y:\2011\DESPESAS\FECHAMENTO MENSAL\BASES MACRO\ACT ROP Cognos.mdb];
And remember: you can't SELECT fields you don't have in the subquery:
BDU, DESC_CONTA_CTB, LINHA_DESPESA, NOMEGDN and NOMEREDE are not in the subquery, so you can't query for them. Either use 2 load statements or add them into the Subquery, right before the switch statement I just posted.
I don't have Access to test if it works. But, really, you should understand what's going on.