Any help on this would be appreciated. I'm losing what little hair I have left!
I am trying to query a range within a range. I have a table which has a ProjStartDate and a ProjEndDate field. There is also an AnnualSalary field. My report has a RptStartDate and a RptEndDate. I am trying to have the report show the salary calculation for any projects with dates within the range of RptStartDate and RptEndDate.
I've calulated the monthly salary (AnnualSalary/12). I've calculated the number of months between a range to multiply by the monthly salary. This part works fine.
My query is set so the start date is StartDate: IIF([RptStartDate]>[ProjStartDate],[RptStartDate],[ProjStartDate]) and the end date is EndDate: IIF ([RptEndDate]<[ProjEndDate],[RptEndDate],[ProjEndDate])
This works well for any projects that have start or end dates that fall withing the report range. What it is failing to pickup is any project that has larger date range than the report date range. (It won't pick up a project with a range of 1/1/05 - 12/31/06 if the report range is 1/1/06 - 6/30/06)
Ultimately what I want is the salary for each project for just the months within the report date ranges. Help!?
I am trying to query a range within a range. I have a table which has a ProjStartDate and a ProjEndDate field. There is also an AnnualSalary field. My report has a RptStartDate and a RptEndDate. I am trying to have the report show the salary calculation for any projects with dates within the range of RptStartDate and RptEndDate.
I've calulated the monthly salary (AnnualSalary/12). I've calculated the number of months between a range to multiply by the monthly salary. This part works fine.
My query is set so the start date is StartDate: IIF([RptStartDate]>[ProjStartDate],[RptStartDate],[ProjStartDate]) and the end date is EndDate: IIF ([RptEndDate]<[ProjEndDate],[RptEndDate],[ProjEndDate])
This works well for any projects that have start or end dates that fall withing the report range. What it is failing to pickup is any project that has larger date range than the report date range. (It won't pick up a project with a range of 1/1/05 - 12/31/06 if the report range is 1/1/06 - 6/30/06)
Ultimately what I want is the salary for each project for just the months within the report date ranges. Help!?