I have a baq with parameters for Month and Year. I then use these parameters to get the fiscal period start and end dates from the FiscalPer table. I created an InnerSubQuery called FiscalCalendar with the FiscalPer table by itself. The table criteria limits data to fiscal month and year input by the user.
In another InnerSubQuery I have the following as subquery criteria: orderrel.reqdate <= ANY value(s) of FiscalPer_EndDate field from FiscalCalendar SubQuery. This gives me the ending date for the fiscal period since the table data is limited in the subquery using table criteria as mentioned above.
I use this same technique in another innersubquery to get invoices where the apply start / end dates are based on the same “ANY value(s)…” used above.
The problem is that the BAQ takes an extemely long time compared to when I just had the user enter the dates.
Snip of the FiscalCalendar Subquery with Criteria:
Snip of usage of FiscalCalendar Query in Criteria:
Any help would be greatly appreciated. Should FiscalCalendar be a CTE maybe? Thanks Tony