Hi Erel and DaveW,
I’m elaborating what I did to have help from you. I have a listbox and a table. The table is populated by the selection changed (name of individuals) event of the listbox.
Sub listname_SelectionChanged (Index, Value)
... ...
If listname.SelectedIndex >=0 Then
cmd3.CommandText="select bdate,hpid from hhmem where name = "& "'"&listname.Item(listname.SelectedIndex)&"'" &" order by hpid"
cmd3.ExecuteTable("table18",0)
End If
... ...
End Sub
The table still shows the timestamp part in the “bdate” column of tableX.
Then used the strIndexof and substring to get rid of timestamp part in the TableX_SelectionChanged event and it works :
Sub TableX_SelectionChanged (ColName, Row)
... ...
i=tableX.SelectedRow
space_position=StrIndexOf("'"&tableX.Cell("bdate",i)&"'"," " ,0)
‘ vbdate is a global variable
vbdate=SubString("'"&tableX.Cell("bdate",i)&"'",1,space_position)
Msgbox(vbdate)
... ...
End Sub
I want the timestamp part would not be shown in the tableX.
Then I tried as per Erel’s suggestion :
Sub listname_SelectionChanged (Index, Value)
... ...
If listname.SelectedIndex >=0 Then
cmd3.CommandText="select strftime('%d-%m-%Y','bdate')as Bdate,hpid from hhmem where name = "& "'"&listname.Item(listname.SelectedIndex)&"'" &" order by hpid"
cmd3.ExecuteTable("tableX",0)
End If
... ...
End Sub
But the tableX shows “null” in the “bdate” column.
Please correct me.
Regards,