Home Forums SQL Server 2008 T-SQL (SS2K8) Decimal to DateTime2 conversion SQL SERVER 2008 help RE: Decimal to DateTime2 conversion SQL SERVER 2008 help

  • jampabsatish (9/24/2012)


    It works like a champ

    Thank you very much Chris !!

    You're welcome, and thanks for the feedback. Note that both the problem and the solution appear earlier in this thread;

    ssurve (9/22/2012)


    ...

    Just add where clause in your second SQL statement

    where clx.aprvdt<>0

    or write case statement in select as

    convert(datetime,CONVERT(nvarchar(27),case when clx.aprvdt=0 then NULL else clx.aprvdt end)) as ADate

    and try....

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden