Calculate Querry Result

  • Querry:

    SELECT Count(process) As Process, (SELECT count(m_stat) where m_stat = 'Failure') As Status FROM database

    WHERE date BETWEEN DATEADD(dd, - 30, GETDATE()) AND GETDATE()

    Group by m_stat

    Result :

    Process

    1

    5

    45

    2

    I am not sure how to multiply the results in SQL:

    ((1 + 5 + 45 + 2) - (1 + 5 = 2) / 45 x 100

    Can anyone show me where I need to go to create this calculation in SQL.

    Thank you

  • What would the formula look like? Not having sample values, but a more general description.

    Like (SUM(all values)+(values with < condition >) * < other values with different condition >)/MAX(value)*100



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

Viewing 2 posts - 1 through 1 (of 1 total)

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