Ok have used the record selection formulas plenty but now I have an issue I can seem to get. Fiscal Year runs from 11/1 to 10/31. Trying the following to gets records through the end of the month and year selected as parameters when teh report is called from a VB app. If I remove all but the plant parameter and one datepart line of code, report works fine. All 3 lines of the datepart code return values when the are the only month/year criteria. When I try 2 combos or all 3 the report is blank. I have tried or after the datepart lines. Have also tried placing the plant = plant lline with each group. Any ideas?
if {?Month} < 11 then
{SalesDetailTable.Plant} = {?Plant} and
datepart("m",{SalesDetailTable.Rundate}) <= {?Month}and datepart("yyyy",{SalesDetailTable.Rundate}) = {?Year} and
datepart("m",{SalesDetailTable.Rundate}) = 11 and datepart("yyyy",{SalesDetailTable.Rundate}) = ({?Year}-1) and
datepart("m",{SalesDetailTable.Rundate}) = 12 and datepart("yyyy",{SalesDetailTable.Rundate}) = ({?Year}-1)