WHERE 
		(
			(@iDateType = 1 AND dtTransactionDate BETWEEN @dStartDate AND @dEndDate) -- Use Transaction Date
			OR
			(@iDateType = 2 AND dtBusinessDate BETWEEN @dStartDate AND @dEndDate) -- Use Business Date
			OR
			(@iDateType = 3 AND dtPostedDate BETWEEN @dStartDate AND @dEndDate) -- Use Posted Date
		)
		AND
		(@iLocationId = -1 OR iLocation = @iLocationId)
		AND 
		(@vcStatus = 'All' OR (ISNULL(vcStatus,'No Status') IN (@vcStatus)))
Last modified: January 7, 2021

Author

Comments

Write a Reply or Comment