henrik staun poulsen (10/27/2010)
'31-Jan-2010'It that the correct (international) way to hard-code dates?
I think I would have used '2010-01-31' or is it '20100131' to ensure that it will work around the globe?
date is displayed as per your database/server setting.
you need to convert the string into DATE format if you want only DATE portion (applicable for SQL 2k8 only) or DATETIME format if you want date & time both like:
SELECT CONVERT(DATE, '10/27/2010')
if you want to set variable then SELECT @dateValue = CONVERT(DATE, '10/27/2010')
Thanks