looking to create a transaction date referring to previous dates from fact table in xps...


DECLARE @vDate smalldatetime
SELECT @vDate = getdate()

SELECT 'Previous Date' = DATEADD(DD,(SELECT CASE DATEPART(DD,@vDate) WHEN 2 THEN -3 WHEN 1 THEN -2 ELSE -1 END),@vDate)

using this in a relational tool w/out direct access to db....works well enough....taking too long to return results....no indexing in xps.....any thoughts????