Geoff
Member since May 13, 2010
- Profile: /members/6025-geoff.htm
- Comments: 5
Recent Blog Comments By Geoff
-
Getting Only the Date Part of a Date/Time Stamp in SQL Server
Posted on Jul 5, 2010 at 11:57 AM
Russ, My explanation was in relation to a person stating that sometimes they found CONVERT was deterministic and sometimes not. All your examples are determistic but the reason why is not stated. Thanks for your posts I did find them useful. Kind Regards, Geoff... read more »
-
Getting Only the Date Part of a Date/Time Stamp in SQL Server
Posted on Jul 5, 2010 at 11:28 AM
In reply to R A Valencourt on deterministic functions. My colleagues and I found that as stated in the manual ---------------------------------------------- CONVERT Deterministic unless one of these conditions exists: Source type is sql_variant. Target type is sql_variant and its source type is ... read more »
-
Getting Only The Date Part Of A Date/Time Stamp in SQL Server (Revisited)
Posted on May 13, 2010 at 8:37 AM
SELECT CAST(CAST(@testdate AS INT) - DATEPART ( hh , @testdate ) / 12 AS DATETIME) Works but not sure it is better than what you have with float... read more »
-
Getting Only The Date Part Of A Date/Time Stamp in SQL Server (Revisited)
Posted on May 13, 2010 at 8:30 AM
Above comment by me errored rounds up and down above and below midday... read more »
-
Getting Only The Date Part Of A Date/Time Stamp in SQL Server (Revisited)
Posted on May 13, 2010 at 8:25 AM
You could also try SELECT CAST(CAST(@testdate AS INT) - 1 AS DATETIME) INstead of using float, no need to use floor then... read more »