Please could someone help with the following SQL syntax issue.
I have a SQLite table and the following works great:
The WebView table populates great and shows all products and their data.
Now I need to be able to obtain the SUM of each product using the "Barcode" field as the filter.
I have tried:
But I only get 1 record from the table.
I have a SQLite table and the following works great:
B4X:
Sub ShowSalesAll
Dim Query As String
Query = "SELECT barcode As [BARCODE], description As [PRODUCT], units As [SALES], date As [LAST SALES DATE] FROM transactions ORDER BY description"
wbvManagerSales.LoadHtml(ExecuteHtml(SQL1, Query, Null, 0, True))
End Sub
Now I need to be able to obtain the SUM of each product using the "Barcode" field as the filter.
I have tried:
B4X:
Sub ShowSalesAllTotals
Dim Query As String
Query = "SELECT DISTINCT barcode As [BARCODE], description As [PRODUCT], SUM(units) As [SALES], date As [LAST SALES DATE] FROM transactions WHERE units <> '0' ORDER BY description"
wbvManagerSales.LoadHtml(ExecuteHtml(SQL1, Query, Null, 0, True))
End Sub