DECLARE @StartMonth INT,@StartYear VARCHAR(4),@EndMonth INT,@EndYear varchar(4);
SET @StartMonth = 7
SET @StartYear = 2001
SET @EndMonth = 06
SET @EndYear = 2004
SELECT SpecialOfferID,[Description],StartDate,EndDate
FROM Sales.SpecialOffer
WHERE MONTH(StartDate) = @StartMonth AND YEAR(StartDate) = @StartYear
AND MONTH(EndDate) = @EndMonth AND YEAR(EndDate) = @EndYear
No comments:
Post a Comment