0
I am generating a Query and in this Query I am making a Join between a field varchar
and a field float
.
Being the field SY.YE_MOEDA
is varchar
and the countryside DA1_A1_MOEDA
is float
.
Follow my Query:
SELECT
DA.DA1_CODTAB AS TABELA,
DA.DA1_CODPRO AS CODPRODUTO,
SB.B1_DESC AS DESCRICAO,
SB.B1_PRV1 AS PRECOVENDA,
DA.DA1_MOEDA AS MOEDA,
SY.YE_MOEDA AS NOMEMOEDA
FROM DA1010 AS DA
INNER JOIN SB1010 AS SB WITH (NOLOCK) ON SB.B1_COD = DA.DA1_CODPRO
INNER JOIN SYE010 AS SY WITH (NOLOCK) ON CONVERT(FLOAT, ISNULL(SY.YE_MOEDA,0)) = DA.DA1_MOEDA
WHERE DA.D_E_L_E_T_ <> '*' AND DA.DA1_ATIVO = '1'
Follow the error
Msg 8114, Level 16, State 5, Line 1 Error Converting data type varchar to float.
This is the Protheus?
– Maniero
Yes protheus, but I was able to solve the problem, in the table where the value of the coin had a hidden field with the currency code of type float, and this field solved the Join problem. But thank you very much for your attention
– Junior Guerreiro
Coin
float
is very wrong. https://answall.com/a/38140/101– Maniero