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 7021995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:31:21+00:00 2026-05-27T23:31:21+00:00

Thanks for taking the time to read my question. Imagine a situation where a

  • 0

Thanks for taking the time to read my question.

Imagine a situation where a customer is given a free gift if they open an account. Some ‘customers’ open an account to get the free gift, but never add any money to their account. Other ‘customers’ open accounts, get the free gift and also fund their accounts by adding money to it.

I need to compare the funded accounts to the overall count of all customers.

Things at first appeared quite easy …

 SELECT Audits.AuditDate, Count(Audits.NickName) AS AllAccounts
 FROM Audits
 Group By Audits.AuditDate

This obviously gives me the count of all accounts on a daily basis.

To get the ‘Funded’ count, I do …

 SELECT Audits.AuditDate, Count(Audits.NickName) AS Funded
 FROM Audits 
 WHERE Audits.CurrGBP > 0
 GROUP BY Audits.AuditDate;

This time I get the count of the ‘Funded’ accounts.

Now, this is where I get stuck … I want both counts from the same query so my results would be like this …

AuditDate (DD/MM/YYYY)      AllAccounts Funded
01/01/2012                  50          45
02/01/2012                  60          50
03/01/2012                  70          55

Something is telling me I need to use a Sub Query, but after googling a few pages. Sub Queries are baffling to me.

May I ask for some help please ? Can you show me how to write a Sub Query to give me the results I need.

Regards,
John.

PS – My Audits table has the following fields, Audit_ID, Audit_Date, NickName, CurrGBP and I am using MS Access 2010.

  • 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-27T23:31:22+00:00Added an answer on May 27, 2026 at 11:31 pm

    Cant remember if access supports case; or if IIF is the way to go… but something like…

    A sub query isn’t really needed, you can get the results in one query, just limit what you count when using a case or IIF.

    Select A.AuditDate,
    count (A.NickName) as AllAccounts,
    sum(CASE when A.CurrGBP > 0 then 1 else 0 end) as Funded
    FROM Audits A
    GROUP BY A.AuditDate
    

    if IIF

    Select A.AuditDate,
    count (A.NickName) as AllAccounts,
    sum(IIF(A.CurrGBP >0,1,0)) as Funded
    FROM Audits A
    GROUP BY A.AuditDate
    

    EDIT, was missing some commas in selects.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

and thanks for taking the time to read my question. We will have visitors
Thanks for taking time to read this question. I am designing a 3-tier solution
First of all, thanks for taking the time to read my question, I appreciate
Thanks for taking time to read my questions. I am having some basic doubts
thanks for the taking the time to read my question. I'm pulling information for
thank you for taking some time to read my question. I have this app
First, thanks for taking the time to read this. I'm having some difficulties with
thanks in advance for taking the time to read through my question... /* Binary
Thanks for taking the time to read my question. I am looking for advice
Thanks for taking the time to read... here is my question/scenario, its a quick

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.