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

  • Home
  • SEARCH
  • 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 8621083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:44:16+00:00 2026-06-12T06:44:16+00:00

Im using Access 2007 to import statistics (Excel) from multiple units within a department.

  • 0

Im using Access 2007 to import statistics (Excel) from multiple units within a department. Although they share similar fields, each Unit has it’s own table because they also have unit specific data/fields that needs to be tracked.

Table:UnitA -(Fields:Date,Cars, Boats, Tags, Guns, Missing Persons, etc.)

Table:UnitB -(Fields:Date,Cars, Boats, Tags, Guns, Bench Warrants, etc.)

Table:UnitC -(Fields:Date, Cars, Boats, Tags, Guns, Fingerprints, etc.)

I need to create a summary report that queries a START DATE and END DATE and then produces a report that will display:

Sums of each of the individual fields from each record ie Sum([Fingerprints])
Sums of each of the shared fields from each record ie Sum([UnitA!Cars]) + Sum([UnitB!Cars]) etc.

I can create a report for each individual unit without any problems.

My problem begins when I ceate three Unit reports and try to use subreports. Access will prompt me for new Start Dates and End Dates.

Does anyone have a better solution? Should I create a “prompt” form that includes a Start Date and End Date field that can be accessed from within each query?

  • 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-06-12T06:44:18+00:00Added an answer on June 12, 2026 at 6:44 am

    You can create a single query by using unions

    SELECT Date, Cars, Boats, Tags, Guns,
       [Missing Persons], Null AS [Bench Warrants], Null AS Fingerprints FROM UnitA
    UNION ALL
    SELECT Date, Cars, Boats, Tags, Guns,
       Null,              [Bench Warrants],         Null                 FROM UnitB
    UNION ALL
    SELECTG Date, Cars, Boats, Tags, Guns,
       Null,              Null,                     Fingerprints         FROM UnitC
    

    You must have the same number of fields in each SELECT. The field names of the first SELECT will be used for the result.


    However, I suggest another DB design. Place all the commom fields in a common table and place the unit-specific fields in other tables that you join in a 1-to-1 relation

    CREATE TABLE Unit (
        UnitID  CONSTRAINT PK_unit PRIMARY KEY,
        Date datetime,
        Cars long,
        Boats long,
        Tags long,
        Guns long
    )
    
    CREATE TABLE UnitA (
        UnitID  CONSTRAINT PK_unitA PRIMARY KEY,
        [Missing Persons] Long
    )
    ALTER TABLE UnitA
       ADD CONSTRAINT FK_unitA_unit
       FOREIGN KEY (UnitID) REFERENCES Unit (UnitID)
    
    
    CREATE TABLE UnitB (
        UnitID  CONSTRAINT PK_unitB PRIMARY KEY,
        [Bench Warrants] Long
    )
    ALTER TABLE UnitB
       ADD CONSTRAINT FK_unitB_unit
       FOREIGN KEY (UnitID) REFERENCES Unit (UnitID)
    
    
    CREATE TABLE UnitC (
        UnitID  CONSTRAINT PK_unitC PRIMARY KEY,
        Fingerprints Long
    )
    ALTER TABLE UnitC
       ADD CONSTRAINT FK_unitC_unit
       FOREIGN KEY (UnitID) REFERENCES Unit (UnitID)
    

    Now you can create a query with left joins.


    An even easier design is to create just one table, and to allow empty fields

    CREATE TABLE Unit (
        UnitID  CONSTRAINT PK_unit PRIMARY KEY,
        Date datetime,
        Cars long,
        Boats long,
        Tags long,
        Guns long,
        [Missing Persons] Long,
        [Bench Warrants] Long,
        Fingerprints Long
    )
    

    Instead of importing the excel tables directly, just link the excel tables and then append their content to the common table with customized append queries.

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

Sidebar

Related Questions

I have problem creating new instance of excel 2007 using VBA (from Access 2002).
I'm Using Excel/Access 2007. I made an Access query in Access, and I tried
Using Access 2007 vba addressing an Excel 2007 workbook (WB).... This routine adds a
I am able to successfully connect from access 2007 into SQL Server 2008 using
I have the following problem in a Database using Access 2007 as front end
I've posted a demo Access db at http://www.derekbeck.com/Database0.accdb . I'm using Access 2007. I
So I wrote a project-management program for a small business using Microsoft Access 2007.
Background info : I was handed a Tool, which was made using MS-Access 2007,
Using Access 2003 I want to get a table value from the two databases
I am using Access 2007 to create an SQL query to join two tables.

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.