Home Forums SQL Server 2005 T-SQL (SS2K5) Set Variable based on a SELECT RE: Set Variable based on a SELECT
Hunterwood
SSCrazy
Points: 2074
More actions
February 10, 2010 at 8:38 am
#1116880
Hi,
since @mydate is of type DATETIME you get an implicit conversion of your neatly formatted string back to datetime.
Declare @mydate as a CHAR(14), or what you find suitable, and everything should work as expected...
/Markus