Subject Re: Unexpected end of command (SQL error code -104)
Author Adriano
I've solved in that way:
Dim rs As Recordset
query = "SELECT SUM (Importo) as TotaleEntrate " & _
"From Contabile " & _
"Where " & _
"Contabile.Tipo = 'Entrata' AND Contabile.Anno = " + Anno.Text + " " & _
"Union " & _
"SELECT SUM (TotaleFattura) as TotaleEntrateFattura " & _
"From Fatture " & _
"Where " & _
"Fatture.Anno = " + Anno.Text + " "

Set rs = cn.Execute(query, , adCmdText)
MsgBox rs!TotaleEntrateFattura & " " & rs!TotaleEntrate

Unfortunately i receive a run-time error 3265 on the
TotaleEntrateFatture, while the TotaleEntrate is correctly showed.
I've try to execute the query using a query editor (SQL Manager 2005)
and i receive the two data (TotaleEntrate and TotaleEntrateFattura).

Any help ?
Thanks
Adriano