asked on
declare @InputParameterStart varchar(10)
set @InputParameterStart = '11/2010'
declare @month char(2)
declare @year char(4)
declare @StartDate datetime
set @month = substring(@InputParameterStart,1,2)
set @year = substring(@InputParameterStart, 4,4)
--print @month
--print @year
set @StartDate = cast(@year + '/' + @month + '/01' as datetime)
print @StartDate
ASKER
ASKER
Microsoft SQL Server is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.SQL Server is available in multiple versions, typically identified by release year, and versions are subdivided into editions to distinguish between product functionality. Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning.
TRUSTED BY
SaleDate (datetime)
05/01/2011
05/20/2011
04/2/2011
03/2/2011
Then you can query your table like this
select * from table where saledate between '04/04/2011' and '05/20/2011'
and create the two dates as parameter in the query and also give the date range on the days if you want