I have stored 'getdate()' as text in one of my column in a table. (It's a complicated scenario ,how I saved it) Now when I select the field what I am getting is getdate() instead of the date . How can I convert this to date time.
I am adding a sample code to understand this
declare @a varchar(20)='getdate()'
select convert(datetime,@a)
This results in conversion error. How can I convert this to date?