i' trying to get the date as yyyymmdd but i somehow seem to be only getting 20062 7 as in 7th Feb 2006. i wrote an update cursor to do this but not sure if this is the best way to go about doing this

declare @day as char(2)
declare @month as char(2)
declare @year as char(4)
declare @Exportdate as char(10)
declare @isodate as datetime

DECLARE IsoDate CURSOR DYNAMIC FOR

SELECT modifieddate
FROM statenet.dbo.tblCAABimport
WHERE modifieddate <> ''
FOR UPDATE

Open Isodate
FETCH NEXT FROM isodate into @isodate
WHILE (@@FETCH_STATUS = 0)
BEGIN

if len(datepart(d,@isodate)) = '1'
set @day = ('0' + datepart(d,@isodate))
else
set @day = ('0' + datepart(d,@isodate))
print @day

if len(datepart(m,@isodate)) = '1'
set @month = '0' + datepart(m,@isodate)
else
set @month = '0' + datepart(m,@isodate)
print @month

set @year = datepart(yyyy,@isodate)
set @exportdate = @year + @month + @day
print @exportdate

update tblCAABimport
set isodate = @exportdate
Where current of isodate

FETCH NEXT FROM isodate
INTO @isodate
END

CLOSE isodate
DEALLOCATE isodate