0

I want to compare today date and check is it fall into which fiscal month?How to retrieve what is start date and end date of the fiscal month?

When I am google I only found fiscal year and fiscal quarter.Please let me know if this possible or not.

-----------------Updated ---------------------------------

So I use Period object to query but here some confusing data return.

1) Using THIS_MONTH

Select StartDate, EndDate From Period Where type = 'Month' and StartDate = THIS_MONTH

It returns it return StartDate=2016-11-26 , EndDate =2016-12-31 , which is our next month(December).

2) Using NEXT_MONTH Result no data return.

3) Using LAST_MONTH it return two rows data which are current fiscal month and previous fiscal month(October and November).

I confuse, logically it should return November for THIS_MONTH, December for NEXT_MONTH and October for LAST_MONTH,

3

2 Answers 2

1

You need to use Period object and use type = 'Month' for current month and use StartDate = THIS_Month

Date closeDate = [Select EndDate From Period 
                    Where type = 'Month' and StartDate = THIS_Month].EndDate;
1
  • I updated the question as it will be difficult to read if I put here.
    – unidha
    Commented Nov 18, 2016 at 0:48
0

If you are using non-standard fiscal periods, you cannot get away with a native filter assumption that the current fiscal month will begin or end inside the current calendar month. For the current month, at least, you can use:

SELECT StartDate, EndDate FROM Period
WHERE Type = 'Month'
AND StartDate <= TODAY
AND EndDate >= TODAY

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .