Skip to main content

Russell Sneddon

Member since Jan 31, 2010

Recent Blog Comments By Russell Sneddon

  • Getting Only the Date Part of a Date/Time Stamp in SQL Server

    Posted on Jul 5, 2010 at 12:08 PM

    Hey Geoff I'm glad you found my posts useful. Perhaps I misinterpreted your sentence "So the simple chararacter conversion using CONVERT may not be the fastest but it can be deterministic and henced used in indexes."? I thought you meant that it was worth using the slower technique because of its... read more »

  • Getting Only the Date Part of a Date/Time Stamp in SQL Server

    Posted on Jul 5, 2010 at 11:41 AM

    Geoff As I said in my posts, all 16 techniques that I describe are deterministic. They cover a variety of ways of solving the problem, not just character conversion. Russ... read more »

  • Getting Only the Date Part of a Date/Time Stamp in SQL Server

    Posted on Jan 31, 2010 at 2:58 PM

    Actually Brian Young's post directly before mine is technically correct. He suggests using: DATEADD(DAY, DATEDIFF(DAY, 0, @DateTime), 0) instead of using: DATEADD(DAY, 0, DATEDIFF(DAY, 0, @DateTime)) which is a closer representation to what we're trying to achieve. About half the DATEADD exampl... read more »

  • Getting Only the Date Part of a Date/Time Stamp in SQL Server

    Posted on Jan 31, 2010 at 12:16 PM

    Thanks very much for all the useful information. The function below shows 12(!) different techniques (including a few inspired by this thread), which I've proved return identical results for a spread of times on every possible date. Just comment out one line at a time to try each technique. It shou... read more »

I believe in love. I believe in compassion. I believe in human rights. I believe that we can afford to give more of these gifts to the world around us because it costs us nothing to be decent and kind and understanding. And, I want you to know that when you land on this site, you are accepted for who you are, no matter how you identify, what truths you live, or whatever kind of goofy shit makes you feel alive! Rock on with your bad self!
Ben Nadel