||08-15-2005 07:46 AM
Subtracting the day of two dates and recieving an integer answer(VB.NET)
I am using the following code to populate a listbox with id numbers with dates appended to them:
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 + ")")
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?