Hello,
In the system I am currently making I require to know if 1 date is between 2 others.
The 2 dates it must be between are part of a record, and the date which is tested for being between them is a date selected using the calendar.
As an algorithm:
Date1, SmallDate, BigDate <-- TDateTime
between <-- boolean
if (Date1 = SmallDate) or (Date1 = BigDate) then
between = true
else if Date1 is between SmallDate and BigDate then
between = true
else
between = false
I have tried doing it using DaySpan and CompareDate functions, but I couldn't get either to work and am out of ideas.
Thanks
In the system I am currently making I require to know if 1 date is between 2 others.
The 2 dates it must be between are part of a record, and the date which is tested for being between them is a date selected using the calendar.
As an algorithm:
Date1, SmallDate, BigDate <-- TDateTime
between <-- boolean
if (Date1 = SmallDate) or (Date1 = BigDate) then
between = true
else if Date1 is between SmallDate and BigDate then
between = true
else
between = false
I have tried doing it using DaySpan and CompareDate functions, but I couldn't get either to work and am out of ideas.
Thanks