Hi guys!
I have the query below getting data from a MySQL instance using ODBC connection. This query is ok and brings the correct data. Then I have another query, create table type, that refers to this query to create a new table based on the query result. The tables is been created with some fields with incorrect data type. For example, the field ID_Cliente is created with data type Text, but it should be created as Number. I tried to use cast function to convert, but without success.
Is there a way to tell Access the destination data type of each field when the query is creating the table?
SELECT CAST(custp.no AS SIGNED INTEGER) ID_Cliente, LEFT(custp.zip,8) CEP,
custp.nei1 Bairro,
custp.city1 Cidade,
LEFT(custp.ddd,2) DDD_Telefone,
LEFT(custp.tel,8) Telefone,
ctcel.ddd DDD_Celular,
MAX(ctcel.celno) Celular,
ctmore3.auxstring6 Email
FROM sqldados.custp
LEFT JOIN sqldados.ctmore3 ON (ctmore3.custno = custp.no)
LEFT JOIN sqldados.ctcel ON (ctcel.custno = custp.no)
GROUP BY custp.no
ORDER BY custp.no
Thanks a lot