Hi experts,
Please how can i Verify IF a date is between two Dates .
e.g
how to verify if 05/02/2010 is in this interval 01/02/2010 and 31/07/2011
thank's
*This post is locked for comments
Hi,
You may use the if condition.
IF (inputdate >= Date1) AND (inputdate <= date2) THEN
Let NAV be your guide. Have a look in one of the "Check Line" codeunits.
You will find this code which is more or less doing what you are asking:
IF ("Posting Date" < AllowPostingFrom) OR ("Posting Date" > AllowPostingTo) THEN
FIELDERROR("Posting Date",Text001);
by code:
if (YourDate >= DMY2DATE(1,2,2010)) and (YourDate <= DMY2DATE(31,7,2011)) then
begin
// do something
end;
by code filtering:
rec.setfilter(YourDateField,'>=%1',DMY2DATE(1,2,2010));
rec.setfilter(YourDateField,'<=%1',DMY2DATE(31,7,2010));
if rec.findfirst then
by properties:
goto field properties and set values for MinValue and MaxValue.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Alexander Ermakov 2
SC666 1