If you want to calculate days between dates which have different years, you can use a variable type DURATION to keep the day count.
:P
// From C/SIDE Reference Guide DURATION
Use this data type to represent the difference between two datetimes, in milliseconds. This value can be negative. It is a 64 bit integer.
of, if possible, take a look in Codeunit 6 and Codeunit 8 (into Function SetGLAccColumnFilters) to see other working code examples for the calculation of date filters.
Comments
For calculating dates is function CALCDATE...
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
:P
// From C/SIDE Reference Guide
DURATION
Use this data type to represent the difference between two datetimes, in milliseconds. This value can be negative. It is a 64 bit integer.
DATETIME-DATETIME=DURATION
DATETIME-DURATION=DATETIME
DATETIME+DURATION=DATETIME
of, if possible, take a look in Codeunit 6 and Codeunit 8 (into Function SetGLAccColumnFilters) to see other working code examples for the calculation of date filters.