You need to sign in to do that
Don't have an account?
Swamy P
How to know whether current date is in last 10 business working days of an Quarter or not
Hello Everyone,
I just wanted to know whether current date is in last 10 business working days of an Quarter or not, So how can i get it?
We have a Quarter query, with that we can fetch End Date of the Quarter. So finally how can i check whether current date is in last 10 business working days of an Quarter or not?
Your help will be really appreciated!!!
I just wanted to know whether current date is in last 10 business working days of an Quarter or not, So how can i get it?
We have a Quarter query, with that we can fetch End Date of the Quarter. So finally how can i check whether current date is in last 10 business working days of an Quarter or not?
Your help will be really appreciated!!!
Period PFQ = [Select StartDate, EndDate From Period Where type = 'Quarter' and StartDate = THIS_FISCAL_QUARTER];
if(PFQ!=null){
Date endDate = PFQ.EndDate; Date strtDate=PFQ.EndDate-14; Date tdy=Date.Today();
Integer numberOfDays = Date.daysInMonth(tdy.year(), tdy.month());
Date lastDateOfMonth = Date.newInstance(tdy.year(), tdy.month(), numberOfDays);
Date startDateOfReconcile = lastDateOfMonth-14;
if((tdy>=strtDate && tdy<=endDate) || (tdy.month()==8 && tdy.year()==2016 && tdy>=startDateOfReconcile && tdy<=lastDateOfMonth)){
LOGIC
}