1
Guys, I need someone’s help to understand the mistake you’re making. I have two tables as the code shows, and in one of the tables the column "Code" is with information. I need to enter the codes related to the Beneficiaries. But you’re making a mistake:
Syntax "Incorrect Syntax near the keyword 'FROM' "
SELECT [SemPlano].[NomeBenefTitular] AS [BenfTitularS],
[ComPlano].[NomeBenefTitular] AS [BenfTitularC],
[SemPlano].[NomeUsuario] AS [NomeUsuarioS],
[ComPlano].[NomeUsuario] AS [NomeUsuarioC],
[SemPlano].[CodigoPlano] AS [CodPlanoS],
[ComPlano].[CodigoPlano] AS [CodPlanoC],
FROM [TabelaUm] AS [SemPlano]
INNER JOIN [TabelaDois] AS [ComPlano] ON [BenfTitularS] = [BenfTitularC]
Using the alias created for the fields in INNER JOIN causes error, in my reply I show how the search should be done correctly.
– Paulo R. F. Amorim