Prev: DB Connection Pooling
Next: TOP clause
From: Plamen Ratchev on 6 Apr 2010 17:43 Justin D. wrote: > The data type is, actually, Varchar 50 and it shows up as > 2008-03-24 00:00:00 > Then you are using wrong format style to convert it. Try this: SELECT DATEDIFF(DAY, CURRENT_TIMESTAMP, CONVERT(DATETIME, CASE WHEN ISDATE(tblMain.dtOpen) = 1 THEN tblMain.dtOpen END, 120)) -- Plamen Ratchev http://www.SQLStudio.com |