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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:16:47+00:00 2026-05-24T02:16:47+00:00

I have 2 queries called 3 Month Query and 6 Month Query. Now I’m

  • 0

I have 2 queries called “3 Month Query” and “6 Month Query”. Now I’m creating a report with a query as a record source. I want to count the number of rows in 3 Month Query and label it as Need3Month, and the number of rows in 6 Month Query and label it as Need6Month. I tried the following which is not working:

SELECT COUNT([3 Month Query].[ID]) AS Need3Month, COUNT([6 Month Query].[ID]) AS Need6Month FROM [3 Month Query], [6 Month Query];

And I also tried:

SELECT COUNT([3 Month Query].[ID] AS Need3Month FROM [3 Month Query]
UNION
SELECT COUNT([6 Month Query].[ID] AS Need6Month FROM [6 Month Query];

This returns the right numbers but lists them both under a Need3Month column.

What am I supposed to do? Any help is much appreciated.

  • 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-24T02:16:48+00:00Added an answer on May 24, 2026 at 2:16 am
    SELECT
      (SELECT COUNT([ID]) FROM [3 Month Query]) AS Need3Month,
      (SELECT COUNT([ID]) FROM [6 Month Query]) AS Need6Month
    

    UPDATE in reply to comments:

    SELECT
      COUNT([ID]) AS Need3Month,
      (SELECT COUNT([ID]) FROM [6 Month Query]) AS Need6Month
    FROM [3 Month Query]
    

    UPDATE 2

    This should also work (I think):

    SELECT
      Cnt6.Cnt AS Need3Month,
      Cnt3.Cnt AS Need3Month
    FROM
      (SELECT COUNT([ID]) AS Cnt FROM [3 Month Query]) AS Cnt3,
      (SELECT COUNT([ID]) AS Cnt FROM [6 Month Query]) AS Cnt6
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have some queries which group datasets and count them, e.g. SELECT COUNT(*) FROM
I have several sql queries that I simply want to fire at the database.
I have series of records in a table called 'hits' and each record has
I want to select rows from a table called Users where the column Logon
I have a while loop from a query called $result . Inside this while
I have some queries regarding the service layers. I have some DAOs called EmployeeDAO,ProjectDAO,etc.
I have 2 queries that are as follows: SELECT COUNT(cvu.[ID]), 'Exp' AS [Exp] FROM
I have a table (in MySQL) called unused with about 5.4 million rows. The
I have two queries that are basically the same: OLD TRANSACTIONS QUERY SELECT t.payment_method,
I have some code that when called calls a webservice, queries a database and

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.