B4X:
Sub acActionBarLight_MenuItemClick (Item As ACMenuItem)
Dim strQuery As String
Dim cur As Cursor
Dim value As String
Dim acPopUp As ACPopupMenu
acPopUp.Initialize("acPopUp", dummyPanel)
strQuery = "SELECT DISTINCT(DATE) AS DT FROM TABLE_RECORDS"
cur = sqlDB.ExecQuery(strQuery)
For i = 0 To cur.RowCount - 1
cur.Position = i
value = cur.GetString("DT")
acPopUp.AddMenuItem(i, DateTime.GetYear(value), Null)
Next
acPopUp.Show
End Sub
The code above works the problem is that it loads on the menu all the years including those with 2 or more occurencies. How i will load only the distinct values of the query? Thank you!