Compare dates from excel list to todays date

Hello,

I have the following date fields in an excel file:

43558.40916
43558.50964
43558.57628
43558.6306
43558.63231
43558.68537
43558.70476
43558.7085
43558.71978
43558.98116
43559.39618
43559.41098
43559.4405
43559.44215
43559.44286
43559.46319
43559.58272
43559.58725
43559.59823

I need to iterate through all these dates and compare them to todays date and figure out which ones are >= 3. So if Todays date - row(0) > 3, then assign…

Try this:
DateTime.FromOADate(Convert.ToDouble(“Your Date come here”)).ToString.
Now you will get the date format, you can build any logic.
Get the data in DataTable using read range, then use for each row to iterate.

And if you want to check day of dates, CDate(“Date”).Day, similarly you can find in second date and then compare.
You can also use DateDiff(first date, second date)

1 Like

thanks for that!

I ended up using Datetime.FromOADate(cdbl(row(3).tostring)).ToShortDateString

and then your date diff.

seems to work!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.