• IgorMi (5/3/2013)


    ChrisM@Work (5/3/2013)


    IgorMi (5/3/2013)


    ChrisM@Work (5/3/2013)


    IgorMi (5/3/2013)


    Hi

    SELECT sum(CONVERT(float, ft.amount))

    FROM filetransaction ft

    WHERE ft.fileid <>332 and ISNUMERIC(ft.amount)=1

    Check this also http://www.sqlservercentral.com/articles/IsNumeric/71512/

    Regards

    IgorMi

    Which of those two filters will SQL Server apply first?

    Queries having WHERE clause connected by AND operators are evaluated from left to right in the order they are written.

    What is the source for this statement? It's completely wrong.

    Aham

    I now see. It should be:

    SELECT sum(CONVERT(float, ft.amount))

    FROM filetransaction ft

    WHERE ISNUMERIC(ft.amount)=1

    I copied ft.fileid <>332 mistakenly.

    Do you want to include the rows where ft.amount cannot be converted to a numeric datatype?

    “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