You need to sign in to do that
Don't have an account?
@ M Coder
Userdate shouldnot be in range of StartDate and EndDate Ranges in apex saleforce
I have basically 3 dates startdate , enddate and userdate .
Question : i have a batch which should pick the records where the Userdate SHOULD NOT fall in between the Range of startdate and enddate .
can anyone please modify my snippet of code.
my code snippet:
Date userDate =Date.newInstance(2018, 11, 31);
Date startdate =Date.newInstance(2017, 1, 31);
Date enddate =Date.newInstance(2017, 12, 31);
if(userDate < startDate && endDate > userDate )
{
system.debug('True');
}else
{
system.debug('false');
}
Question : i have a batch which should pick the records where the Userdate SHOULD NOT fall in between the Range of startdate and enddate .
can anyone please modify my snippet of code.
my code snippet:
Date userDate =Date.newInstance(2018, 11, 31);
Date startdate =Date.newInstance(2017, 1, 31);
Date enddate =Date.newInstance(2017, 12, 31);
if(userDate < startDate && endDate > userDate )
{
system.debug('True');
}else
{
system.debug('false');
}
Trying using below method and let us know if it works.