I want to pass a string sample '02/01/2015' or any day of that month and get the following.
@enddate should return '03/01/2015' (the beginning of next month)
@month should return '02'
@year should return '2015'
Declare @EndDate as varchar(12)
declare @month as varchar(2)
declare @year as varchar(4)
Set @EndDate = @startdate > should be '03/01/2015' (the first day of next month)
Set @Month = @startdate > should be '02'
Set @Year = @startdate > should be '2015'
select MONTH('02/01/2015') < how can I return '02' instead of '2'
select YEAR('02/01/2015') < this is ok '2015'