shows error
Msg 156, Level 15, State 1, Line 16
Incorrect syntax near the keyword 'CONVERT'.
DECLARE @STARTDATE AS DATE;
DECLARE @EntDt AS DATE;
set @STARTDATE = '06/01/2012';
set @EntDt = '12/31/2012';
declare @dcnt AS int;
with DateList as
(
select @STARTDATE DateValue
union all
select DateValue + 1 from DateList
where DateValue + 1 < convert(VARCHAR(15),@EntDt,101)
)
INSERT INTO mtblAttendance
select u.User_Id,
Convert(VARCHAR(10),CONVERT(DATETIME,CONVERT(VARCHAR(10), DateValue, 121)) + ' 09:30:00', 121) As In_Time,
Convert(VARCHAR(10),CONVERT(DATETIME,CONVERT(VARCHAR(10), DateValue, 121)) + ' 09:30:00', 121) As Out_Time
from DateList, mtblEmployee u
where DATENAME (dw, DateValue ) not IN ( 'Saturday','Sunday' )
option (maxrecursion 365);