Mi sapete dire cosa c'e' che non va in questa Query ???
Mi restituisce questo errore:
-----------------------------------------------------------
Eccezione non gestita di tipo "System.IndexOutOfRangeException" in system.data.dll
Informazioni aggiuntive: Num_Tot
-----------------------------------------------------------
se commento quel rigo di codice mi da quest'altro errore:
-----------------------------------------------------------
Eccezione non gestita di tipo "System.IndexOutOfRangeException" in system.data.dll
Informazioni aggiuntive: Result_Sum
-----------------------------------------------------------
Perche non mi legge i campi virtuali che ho creato ???
_EXTEND_ contiene un estenzione della query che implementa con vari parametri da selezionare tramite degli strumenti..........
codice:Dim sSQL_Count As String = "SELECT " & _ "COUNT(Vendite.Quantita) AS Num_Tot, " & _ "SUM(Vendite.Quantita) AS Result_Sum " & _ "FROM Vendite " & _ "LEFT JOIN Clienti ON Vendite.ID_Cliente=Clienti.ID_Cliente " & _ "LEFT JOIN Segmenti ON Clienti.ID_Segmento=Segmenti.ID_Segmento " & _ "LEFT JOIN Agenti ON Vendite.ID_Agente=Agenti.ID_Agente " & _ "LEFT JOIN Articoli ON Vendite.ID_Articolo=Articoli.ID_Articolo " & _ "LEFT JOIN Categorie ON Vendite.ID_Categoria=Categorie.ID_Categoria " & _ "WHERE ID_Vendite >0 " & _ "" & _EXTEND_ & " " & _ "ORDER BY Vendite.Firma_Contratto DESC " TextBox1.Text = sSQL_Count 'mi serve per vedere la query e poterle copiare nel mySQL-Front per il test... oConn.Open() Dim oComm_1 As New OleDbCommand(sSQL_Count, oConn) Dim oRead_1 As OleDbDataReader = oComm_1.ExecuteReader oRead_1.Read() n = oRead_1("Num_Tot").ToString QuantitaTot = oRead_1("Result_Sum").ToString oConn.Close()