Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15567

Check if Date is greater than todays date

$
0
0
Hello:

VBA Excel (very old school insanity).

I have this very simple line:

Code:

        If (Format(rs.Fields("ShipDate"), "yyyy-mm-dd") > Format(Now(), "yyyy-mm-dd")) = True Then
On these dates:
Code:

===>1979-01-01 > 2020-10-21
===>1979-01-01 > 2020-10-21
===>1979-01-01 > 2020-10-21
===>1979-01-01 > 2020-10-21
===>1979-01-01 > 2020-10-21
===>1979-01-01 > 2020-10-21
===>1979-01-01 > 2020-10-21
===>1979-01-01 > 2020-10-21
===>1979-01-01 > 2020-10-21
===>1979-01-01 > 2020-10-21
===>1979-01-01 > 2020-10-21
===>1979-01-01 > 2020-10-21
===>2020-08-20 > 2020-10-21
===>1979-01-01 > 2020-10-21
===>1979-01-01 > 2020-10-21
===>1979-01-01 > 2020-10-21
===>2021-02-22 > 2020-10-21
===>2021-02-22 > 2020-10-21
===>2021-02-22 > 2020-10-21
===>2021-02-22 > 2020-10-21
===>2021-02-22 > 2020-10-21
===>2021-02-22 > 2020-10-21
===>2021-02-22 > 2020-10-21
===>2021-02-22 > 2020-10-21
===>2021-02-22 > 2020-10-21
===>2021-02-22 > 2020-10-21
===>2021-02-22 > 2020-10-21
===>2021-02-22 > 2020-10-21
===>2021-02-22 > 2020-10-21
===>2021-02-22 > 2020-10-21
===>2021-02-22 > 2020-10-21
===>2020-09-28 > 2020-10-21
===>2020-09-28 > 2020-10-21
===>2020-11-16 > 2020-10-21
===>2020-11-16 > 2020-10-21
===>2020-11-16 > 2020-10-21
===>2020-11-16 > 2020-10-21
===>2021-01-25 > 2020-10-21
===>2021-01-25 > 2020-10-21
===>2021-01-25 > 2020-10-21
===>2021-01-25 > 2020-10-21
===>2021-01-25 > 2020-10-21
===>2021-01-25 > 2020-10-21
===>2021-01-25 > 2020-10-21
===>2021-01-25 > 2020-10-21
===>2021-01-25 > 2020-10-21
===>2021-01-25 > 2020-10-21
===>2021-01-25 > 2020-10-21
===>2021-01-25 > 2020-10-21
===>2021-01-25 > 2020-10-21
===>2021-03-22 > 2020-10-21
===>2021-03-22 > 2020-10-21
===>2021-03-22 > 2020-10-21
===>2021-03-22 > 2020-10-21
===>2021-03-22 > 2020-10-21
===>2021-03-22 > 2020-10-21
===>2021-03-22 > 2020-10-21
===>2021-03-22 > 2020-10-21
===>2021-03-22 > 2020-10-21
===>2021-03-22 > 2020-10-21
===>2021-03-22 > 2020-10-21
===>2021-03-22 > 2020-10-21
===>2021-03-22 > 2020-10-21
===>2020-09-11 > 2020-10-21
===>2021-01-25 > 2020-10-21
===>2021-01-25 > 2020-10-21
===>2021-01-25 > 2020-10-21
===>2021-01-25 > 2020-10-21
===>2021-01-25 > 2020-10-21
===>2021-01-25 > 2020-10-21
===>2021-01-25 > 2020-10-21
===>2020-11-09 > 2020-10-21
===>1979-01-01 > 2020-10-21
===>2020-11-06 > 2020-10-21

Some of the dates are in fact greater than today's date, but I get nothing. If I change it to less than, I get everything, and some of those dates are greater than todays date.

Thanks!

Viewing all articles
Browse latest Browse all 15567

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>