simple date range prompt in sql view
Posted on 2011-03-22
I want my view to prompt me for a date range when I run it. Currently the dates are hard coded.
SELECT TOP (100) PERCENT tDate, tActivityType, tUnits AS Total
WHERE (tUnits <> 0) AND (tActivityType = 1) AND (tDate >= CONVERT(DATETIME, '2010-01-01 00:00:00', 102)) AND (tDate <= CONVERT(DATETIME, '2010-12-31 00:00:00', 102))
How do I replace hard coded dates with prompts or parameters?