sql server - converting string to datetime -
hey guys, want convert datetime string, have string contains 'getdate' want convert same in datetime, string in sql server been defined varchar(max)
please reply how can type cast getdate() function string datetieme.
regards abbas electricwala
i guess mean have string contains text getdate()
this.
declare @s varchar(50) set @s = 'getdate()'
and want turn date variable executing getdate()
.
you since know what getdate()
means.
declare @s varchar(50) set @s = 'getdate()' declare @d datetime set @d = (select case @s when 'getdate()' getdate() else null end)
does not make sense, there more telling.
Comments
Post a Comment