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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:34:48+00:00 2026-05-11T20:34:48+00:00

In MS Access, I have some reports that use some queries, to show data,

  • 0

In MS Access, I have some reports that use some queries, to show data, within a date range. The queries use aliases, if, sum, and avg functions, and join multiple tables to get its data.

I’d like to know if i could use a UNION ALL, with a table that has all the needed fields, to display this new data from this table, along with the older data, if someone selects a range that spans the new and the old.

Here’s an example “old” query:

SELECT tblAssessment.fldValid, tblATraining.fldTID, tblATraining.fldTCrsID, 
tblCourses.fldCrsName, [fldCrsHrs]/8 AS Days, tblATraining.fldTLocAbr, 
tblDistrict.fldDistAbr, tblRegion.fldRegName, tblATraining.fldTDateStart, 
tblATraining.fldTDateEnd, tblATraining.fldTEnrolled, tblATraining.fldTPID, 
tblPersonnel.fldPName, tblAssessment.fldTrngSID, tblAssessment.Q1, 
IIf([fldValid]=True,IIf([Q1]>0,1,0),0) AS Q1Valid, tblAssessment.Q2, 
IIf([fldValid]=True,IIf([Q2]>0,1,0),0) AS Q2Valid, tblAssessment.Q3, 
IIf([fldValid]=True,IIf([Q3]>0,1,0),0) AS Q3Valid, tblAssessment.Q4, 
IIf([fldValid]=True,IIf([Q4]>0,1,0),0) AS Q4Valid, tblAssessment.Q5, 
IIf([fldValid]=True,IIf([Q5]>0,1,0),0) AS Q5Valid, tblAssessment.Q6, 
IIf([fldValid]=True,IIf([Q6]>0,1,0),0) AS Q6Valid, tblAssessment.Q7, 
IIf([fldValid]=True,IIf([Q7]>0,1,0),0) AS Q7Valid, tblAssessment.Q8, 
tblAssessment.Q9, 
IIf([fldValid]=True,IIf([Q9]>0,1,0),0) AS Q9Valid, tblAssessment.Q10, 
IIf([fldValid]=True,IIf([Q10]>0,1,0),0) AS Q10Valid, tblAssessment.Q11, 
IIf([fldValid]=True,IIf([Q11]>0,1,0),0) AS Q11Valid, tblAssessment.Q12, 
IIf([fldValid]=True,IIf([Q12]>0,1,0),0) AS Q12Valid, tblAssessment.Q13, 
tblAssessment.Q14, 
IIf([fldValid]=True,IIf([Q14]>0,1,0),0) AS Q14Valid, tblAssessment.Q15, 
IIf([fldValid]=True,IIf([Q15]>0,1,0),0) AS Q15Valid, tblAssessment.Q16, 
IIf([fldValid]=True,IIf([Q16]>0,1,0),0) AS Q16Valid, tblAssessment.Q17, 
IIf([fldValid]=True,IIf([Q17]>0,1,0),0) AS Q17Valid, tblAssessment.Q18, 
IIf([fldValid]=True,IIf([Q18]>0,1,0),0) AS Q18Valid, tblAssessment.Q19, 
IIf([fldValid]=True,IIf([Q19]>0,1,0),0) AS Q19Valid, tblAssessment.Q20, 
tblAssessment.Q21, 
IIf([fldValid]=True,IIf([Q21]>0,1,0),0) AS Q21Valid, tblAssessment.Q22, 
IIf([fldValid]=True,IIf([Q22]>0,1,0),0) AS Q22Valid, tblAssessment.Q23, 
IIf([fldValid]=True,IIf([Q23]>0,1,0),0) AS Q23Valid, tblAssessment.Q24, 
IIf([fldValid]=True,IIf([Q24]>0,1,0),0) AS Q24Valid, tblAssessment.Q25, 
IIf([fldValid]=True,IIf([Q25]>0,1,0),0) AS Q25Valid, tblAssessment.Q26, 
IIf([fldValid]=True,IIf([Q26]>0,1,0),0) AS Q26Valid, tblAssessment.Q27, 
IIf([fldValid]=True,IIf([Q27]>0,1,0),0) AS Q27Valid, tblAssessment.Q28, 
IIf([fldValid]=True,IIf([Q28]>0,1,0),0) AS Q28Valid, tblAssessment.Q29, 
tblAssessment.Q30, 
tblAssessment.Q31, tblAssessment.Q32
FROM ((tblDistrict 
       LEFT JOIN tblRegion ON tblDistrict.fldDRegID = tblRegion.fldRegID) 
       RIGHT JOIN (((tblATraining 
                     LEFT JOIN tblCourses ON tblATraining.fldTCrsID = tblCourses.fldCrsID) 
                   LEFT JOIN tblPersonnel ON tblATraining.fldTPID = tblPersonnel.fldPID) 
                  LEFT JOIN tblLocations ON tblATraining.fldTLocAbr = tblLocations.fldLID) ON tblDistrict.fldDistAbr = tblATraining.fldTDistAbr) 
     LEFT JOIN tblAssessment ON tblATraining.fldTID = tblAssessment.fldTrngCID
WHERE (((tblAssessment.fldValid)=True) 
        AND ((tblATraining.fldTCrsID) Like [forms]![fdlgRptCriteria].[selCrsCd]) 
        AND ((tblATraining.fldTDateStart) Between [forms]![fdlgRptCriteria].[seldate1] And [forms]![fdlgRptCriteria].[seldate2]) 
        AND ((tblAssessment.fldTrngSID) Is Not Null));
  • 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-11T20:34:48+00:00Added an answer on May 11, 2026 at 8:34 pm

    Yes, but you might consider creating a new querydef for the union.

    (You’ll need to use the SQL design window last time I checked.)

    It would be approximately:

        SELECT
        tblATraining.fldTID,
        tblATraining.fldTCrsID,
        tblATraining.fldTLocAbr,
        tblATraining.fldTDateStart,
        tblATraining.fldTDateStart,
        tblATraining.fldTDateEnd,
        tblATraining.fldTEnrolled,
        tblATraining.fldTPID
    
        UNION ALL
    
        tblATrainingArchive.fldTID,
        tblATrainingArchive.fldTCrsID,
        tblATrainingArchive.fldTLocAbr,
        tblATrainingArchive.fldTDateStart,
        tblATrainingArchive.fldTDateStart,
        tblATrainingArchive.fldTDateEnd,
        tblATrainingArchive.fldTEnrolled,
        tblATrainingArchive.fldTPID
    

    and name it something like tblATrainingUnion.

    Then just plug that into your existing query wherever you have tblATraining.

    Note: Many people also tend to create an archive table sooner than it really makes sense – you might consider just leaving it all in the main table, and make the split when you can actually measure the difference. (You may already have reached that point and done that; and it can make more sense with Access than with say SQL Server.)

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

Sidebar

Related Questions

I have this Access database that we use to run reports. The report is
I have some stuff in settings.py that I'd like to be able to access
I have access to an Oracle server that has some databases that I would
I have an Access form where each record has some info that is computed
We have a 12-year-old Ms Access app that we use for our core inventory
I have created a report in MS Access report and write some VBA code
I have some problems on a site with the concurrent access to a list.
This is a idea for a security. Our employees shall have access to some
I'm responsible for some test database servers. Historically, too many other poeple have access
I have an access query which creates some output, 3 columns named e.g. A

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.