How do you read date from excel and compare?

Good evening friends, a question please;

I wanted to compare two dates, both in a different format, but when I try to pass it to a string, it doesn’t allow me because it reads it as double

Thank you very much in advance

Test_autorellenado_tipoCambio.zip (19.5 KB)

Hi,

It’s excel serial value. Can you try the following condition?

image

 fecha_doc=DateTime.FromOADate(CDbl(fecha_SBS)).ToString("yyyy.MM.dd")

Regards,

1 Like

thank you @Yoichi :slight_smile:

1 Like