as a string field XX/XX/XXXX.
I have done something and it seems to give me the what I need. Let me know if there is an easier way.
I converted Starting Date parameter to a date that is the first day of that month (so 1109 becomes 11/1/2009) and Ending Date parameter to a date that is the last day of that month (1109 would be 11/30/2009). I did the first using a local strinvar and local datevar with the Starting Date. For Ending Date I used the same, but also dateserial(year(dDate), Month(dDate)+1, 1-1).
I then wrote a record selection formula that looks at the month name of the month 5 months previous to the ending date month and if that month name does not come before or is not equal to the month name of the Starting Date, I only allow those records whose Refill Date is greater than or equal to the Starting Date and whose Refill Date is less than or equal to the starting month plus 6 months minus 1 day (so if january is used it will give me records for january 1 through june 30), otherwise, if the Ending Date month is within 6 months of the Starting Date month then I return records whose Refill Date falls within the first day of the Starting Date month through the last day of the Ending Date month.
The code for the selection formula looks like this:
if monthname(month(dateadd('m', -5, {@PrintOption2Date})))>monthname(month({@PrintOption1Date}))
else
and {@DrugDate}<={@PrintOption2Date}
Where Drug Date is refill Date, PrintOption1Date is Starting Date and PrintOption2Date is Ending Date.
Does anyone see any problems with this?
Edited by FrnhtGLI - 13 Nov 2009 at 1:04pm