I am using the following code to populate a listbox with id numbers with dates appended to them:
Code:
Dim coilid, x As String
x = DateTime.Today
For q = 0 To CoilPDIRowCount - 1
lstcoilpdi.Items.Add((PDIDataset.Tables("Table2").Rows(q).Item("ID")) + " (" + x + ")")
lstcoilpdi.Items.Add(q)
Next
I want to be able to create the effect that if an Id has been in the listbox for more than two days, remove it from the listbox. I am trying to find a way to to take the current date and subract from it the date that the id entered the listbox(i.e. x in this case). Does anyone know how to do this?