I have a problem with my ultimate formula of:
ALTER TABLE tempTestProject
ADD [T12 Backdated jnls] varchar(50)
update tempTestProject
set [T12 Backdated jnls] = 'X' where cast([Created Date] as date) > cast([Effective Date] as date)
I get the error:
Conversion failed when converting date and/or time from character string.
Now before I could get to the above I had to rearrange the date I had as I was having issues working with the dates before. I did the following to get my dates into the desired format: (Bare in mind my dates were varchar (50) and in the format 18/01/2014 intially)
ALTER TABLE tempTestProject
ADD [Created Date] varchar(50)
update tempTestProject
set [Created Date] = (RIGHT(["Created Date"],4) + '/' + SUBSTRING(["Created Date"],4,2) + '/'+ LEFT(["Created Date"],2))
ALTER TABLE tempTestProject
ADD [Effective Date] varchar(50)
update tempTestProject
set [Effective Date] = (RIGHT(["Effective Date"],4) + '/' + SUBSTRING(["Effective Date"],4,2) + '/'+ LEFT(["Effective Date"],2))
Hope I explained this enough, thanks for the help!