Trying to convert varchar to datetime

  • dwain.c (7/24/2013)[hrGee whiz! And here I was thinking my STUFF solution was pretty clever.

    Nice one Jeff!

    Thanks, Dwain. Indeed the STUFF solution is clever. I went for the super simple based on a little arcane knowledge that you don't have to select the perfect length string if you want to read to the end of the string. Instead of 5,2 for the substring start and length, I could have just as easily used 5,8000 and it would have produced the same results.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • If your output requirements are driven by business intelligence or analytic needs, you can always use a lookup table (date dimension) as well. If you are interested, let me know, but I think these guys have the issue covered pretty well 🙂

  • Your LOGO is Fantastic how did u do || get that

    please

    thanks.

Viewing 3 posts - 16 through 17 (of 17 total)

You must be logged in to reply to this topic. Login to reply