If you want to do the same thing, but without relying on how dates are held and manipulated in memory, then the following also works :
- WHERE ([YourDateField]<DateAdd('d',-100,Date()))
Remember, calculating the value that the dates need to be compared with is always better than calculating the difference based on the field value as the former calculation need only be done once whereas the latter need be done for each record. This
can have further reach than simply slowing down each record.
It also helps to understand the difference between the
Date()
&
Now()
functions and which values they return. Once understood they can be used appropriately - as illustrated by IslaDogs' example.
PS. Don't get me wrong. It is 100% reliable to work with days as integer values when using dates. This isn't going to change. However, for purists - and the potential for porting the code to other less defined systems - using
DateAdd()
is advisable.