Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
hi guys can tell me " how to subtract days from the given format "format : Mon, 03 Nov 2014 14:10:00 GMT and it is in varchar(50) uunder dates column the data is inserted
gbritton
Master Smack Fu Yak Hacker
2780 Posts
Posted - 2014-12-02 : 09:14:46
e.g.
declare @d varchar(50) = 'Mon, 03 Nov 2014 14:10:00 GMT'select cast(substring(@d, charindex(',', @d,1)+2, 11) as datetime) -1
viggneshwar
Yak Posting Veteran
86 Posts
Posted - 2014-12-12 : 03:32:49
declare @d varchar(50) = 'Mon, 03 Nov 2014 14:10:00 GMT'select cast(substring(@d, 6, 11) as datetime)RegardsViggneshwar A