Sub SetColumnSum(columnID As String)
Dim Column As B4XTableColumn = B4XTable1.GetColumn(columnID)
Dim o() As Object = B4XTable1.BuildQuery(False) 'no page limit
Dim total As Double
Dim rs As ResultSet = B4XTable1.sql1.ExecQuery2(o(0), o(1))
Do While rs.NextRow
total = total + rs.GetDouble(Column.SQLID)
Loop
rs.Close
Dim pnl As B4XView = Column.CellsLayouts.Get(0)
Dim lbl As B4XView = pnl.GetView(0)
'add totals to column header
lbl.Text = columnID & CRLF & "∑ " & Formatter.Format(total)
End Sub