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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:57:05+00:00 2026-05-25T13:57:05+00:00

Using MS Access. I’m sorry that the title is vague–i just don’t exactly know

  • 0

Using MS Access. I’m sorry that the title is vague–i just don’t exactly know how to describe what type of problem this is, I just know that I need to join two tables or queries to solve it.

I have a OrgHistory table that shows which organization each person (by ID) joined on a certain date (you can only be a member of one org at a time):

Person | Org | JoinDate
-----------------------
123    | abc | 3/2/2011
456    | abc | 4/23/1925
123    | def | 5/12/2011

I also have an Activities table:

Person | Activity | ActivityDate
--------------------------------
123    | eat      | 3/23/2011
123    | sleep    | 6/25/2011
456    | walk     | 7/20/1985

I want to find out, for each record in Activities, which organization the person was a member of on the date of the activity. I’m thinking this might involve converting the JoinDate values into a set of ranges and matching ActivityDate to the appropriate interval, but I’m a little confused about how to design the query in this case–how do I create ranges and match an individual value to a range?

I don’t think partition() will work because I’m not trying to hold multiple JoinDate values in a known quantity of buckets.

  • 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-25T13:57:06+00:00Added an answer on May 25, 2026 at 1:57 pm

    I can’t promise this is the most efficient way, but it works in Access with the test data you provided:

    SELECT a.person, a.activity, 
           (
            SELECT TOP 1 org 
              FROM orghistory AS o 
             WHERE o.person = a.person 
                   AND o.joindate <= a.activitydate 
             ORDER 
                BY o.joindate DESC
           ) AS Org
      FROM activities AS a;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following problem in a Database using Access 2007 as front end
I have a project that will be using Access 2003 as the front-end and
I am creating a database application using Access 2003 that will be run as
So I have an access mdb file that was originally create using Access 2003/Office
First off, I'm using Access 2000 and DAO. I have code that executes a
hi I'm having problem with my database. I'm using access as my database and
I'm using Access 2007 to build a normalized database to replace one that uses
Ok I'm using Access 2003 and I've just started learning Access and VBA a
I am using Access 2007 with a pass-through query. The data values that I
im using Access as the database and im having a problem with the query

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.