Date variables store values in floating point format, much like Double variables, with the integer part for dates and the fractional part for the time portion. Being floating point values, Data values may be subject to rounding problems, and for this reason you shouldn’t test two Date variables for equality using the “=” operator.
Instead, use the DateDiff function, or evaluate the difference between the two values and check that it’s less than a very small value, as in:
If Abs(Date1 - Date2) < 1E-10 Then MsgBox "Same dates"End If
Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.




















