Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7408685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:57:28+00:00 2026-05-29T05:57:28+00:00

Just need some help/advice with SQL Server 2005 and Visual Studio 2005. Basically I

  • 0

Just need some help/advice with SQL Server 2005 and Visual Studio 2005.

Basically I have 2 datasets one which results in a total number of good calls and another which results in the number of bad calls.

I want to make a report which shows the rate of good to bad.

For call failures actstatus has “105”

SELECT Country, count(status) AS FailedCalls
FROM termactivity(nolock) 
INNER JOIN termconfig(NOLOCK) ON cfgterminalID = actterminalID
WHERE actstatus IN (105)
GROUP BY country
ORDER BY country

For good calls actstatus has “5” in its cell

SELECT Country, count(status) AS FailedCalls
FROM termactivity(nolock) 
INNER JOIN termconfig(NOLOCK) ON cfgterminalID = actterminalID
WHERE actstatus IN (5)
GROUP BY country
ORDER BY country

Now both of these result in tables with country name and numbers like below

 Country    fails
    AT  240
    BE  3
    CH  1
    CZ  23
    DE  5733
    ES  336
    FR  2
    IE  1066
    IT  7085
    NL  260
    NZ  89
    PT  790

    Country CallSuccess
    AT  5662
    BE  480
    CH  370
    CZ  1124
    DE  19412
    ES  7740
    FR  1976
    IE  26616
    IT  32764
    NL  4046
    NZ  114
    PT  6567

How can I add these to the one layout and eventually have a table like say below:

Country CallSuccess  fails
AT  5662                 240
BE  480                  10
CH  370                  22
CZ  1124                 112
DE  19412                888
ES  7740                 etc..
FR  1976
IE  26616
IT  32764
NL  4046
NZ  114
PT  6567
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T05:57:30+00:00Added an answer on May 29, 2026 at 5:57 am

    COUNT ignores NULL, and the CASE gies NULL for the implied ELSE condition

    SELECT
       Country, 
       count(CASE WHEN actstatus = 105 THEN status END) AS FailedCalls,
       count(CASE WHEN actstatus = 5 THEN status END) AS GoodCalls
    FROM
       termactivity(nolock) 
        INNER JOIN
       termconfig(NOLOCK) ON cfgterminalID = actterminalID
    where actstatus IN (105, 5)
    GROUP BY country
    ORDER BY country
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Help, I am a noob, just need some advice on this bit of code.
I need some advice here, I hope somebody can help me. I have the
I need some help with jQuery script again :-) Just trying to play with
I'm just starting out with the whole ajax thing and I need some help.
Im just starting with localization today and need some information. I have a project
I need some help in auditing in Oracle. We have a database with many
Hi I am hoping for some advice. I have just managed to get a
I need some help creating a query for my mySQL database. I have recently
Need some advice again please. This is regarding a single developer shop. I have
I just need some clarification on variables A normal variable has 2 parts to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.