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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:34:02+00:00 2026-05-17T01:34:02+00:00

I have a query in SQL Server that I am trying to convert to

  • 0

I have a query in SQL Server that I am trying to convert to a query in MS-Access 2003. The query is designed to be used as the basis for a report. The report has two fields .. ‘Cases Assigned’ and ‘Cases Closed’.

SELECT 
(SELECT COUNT(*) 
FROM CaseDetail 
WHERE CaseAssignedDate Between '1/1/2008' AND '1/1/2009') as 'Cases Assigned',
(SELECT COUNT(*) 
FROM CaseDetail 
WHERE CaseClosedDate BETWEEN '1/1/2008' AND '1/1/2009') as 'Cases Closed'

I am having difficulty using the SQL in Access 2003. I have replaced the ' characters with # for Access’s sake but still no joy. Does Access have a problem with SELECT within SELECT statements? The error I get from Access is less than helpful.

Reserved error (-3205); there is no message for this error

Also, what if the SQL statement was such that data needed to be obtained from more than one table. For example …

SELECT 
(SELECT COUNT(*) 
FROM AssignedCases
WHERE CaseAssignedDate Between '1/1/2008' AND '1/1/2009') as 'Cases Assigned',
(SELECT COUNT(*) 
FROM ClosedCases
WHERE CaseClosedDate BETWEEN '1/1/2008' AND '1/1/2009') as 'Cases Closed'

This works in SQL without issue, but not in Access.

  • 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-17T01:34:03+00:00Added an answer on May 17, 2026 at 1:34 am

    Nested queries are allowed in Access as well as in SQL server, but at least in SQL server it requires that you set a dummy alias for your nested query, and all columns in your nested query need a name. This might have caused the error.

    I would suggest following query:

    SELECT q1.CasesAssigned, q2.CasesClosed
    FROM 
    (SELECT COUNT(*) AS CasesAssigned
    FROM CaseDetail 
    WHERE CaseAssignedDate Between '1/1/2008' AND '1/1/2009') as q1,
    (SELECT COUNT(*) AS CasesClosed
    FROM CaseDetail 
    WHERE CaseClosedDate BETWEEN '1/1/2008' AND '1/1/2009') as q2
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Access 2003 database that connects to a SQL Server 2008 box
I have a table in SQL Server 2000 that I am trying to query
I have an SQL Query (For SQL Server 2008 R2) that takes a very
I have created a T-SQL query in SQL Server 2008 R2 that is a
Using Microsoft SQL server 2008 I have a query that is in need of
Using SQL Server 2005 I have a query that gets child records from bundles
I have a Microsoft SQL Server 2008 query that returns data from three tables
I'm using Sql-Server, and I have the below query which returns all columns that
Possible Duplicate: SQL Server Database query help Hi, I have a problem that I
We're using SQL Server 2000 Query Analyser, and one issue we have is that

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.