For multiple date type options… and one set of date range field.
- 1 for Transaction Date
- 2 for Business Date
- 3 for Posted Date
AND
(
(@iDateType = 1 AND dTransactionDate >= @dStartDate AND dTransactionDate < @dEndDate) -- Use Transaction Date
OR
(@iDateType = 2 AND dBusinessDay >= @dStartDate AND dBusinessDay < @dEndDate) -- Use Business Date
OR
(@iDateType = 3 AND dPostedDay >= @dStartDate AND dPostedDay < @dEndDate) -- Use Posted Date
)
Comments