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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:40:10+00:00 2026-05-27T11:40:10+00:00

I have a table activities of activity entries, e.g.: ID | Date | Activity

  • 0

I have a table activities of activity entries, e.g.:

ID | Date       | Activity | Participant
---+------------+----------+
1  | 11/30/2011 | Skiing   | Alice
2  | 11/29/2011 | Diving   | Gary
3  | 10/15/2011 | Running  | Therese

and I’d like to query, for a given date range, which days had an activity and which ones didn’t have anything, for every participant, e.g., for 11/29-11/30,

Date  |  Activity | Participant
------+-----------+------------
11/29 |           | Alice
11/30 | Skiing    | Alice
11/29 | Diving    | Gary 
11/30 |           | Gary
11/29 |           | Therese
11/30 |           | Therese

My current plan is to make a table allDates of all the dates in the year, take a Cartesian product query cartDateParticipant:

select date,participant from allDates,(select distinct participant from activities) as participants

and left join that query against activities:

select a.date, c.activity, c.participant from allDates a
left join
cartDateParticipant c
on
a.date=c.date
and
a.participant=c.participant

which will work, but that means I have to keep a table of dates for any possible date range entered by the user. Is there any way to generate a sequence of dates on the fly in Access without having to store it as a table? Or is there a better way to write this query?

EDIT: The client finally relented and decided that the blank rows were unnecessary, so I just wrote it as a standard 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-05-27T11:40:10+00:00Added an answer on May 27, 2026 at 11:40 am

    I’ll venture an answer since nobody else has. Creating a table of dates is not perhaps particularly cool or clever. However, it is simple to understand, and therefore straightforward to implement and to maintain. I would stick with that method, and say, “no, there’s no better way to write the query” using MS Access.

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

Sidebar

Related Questions

I have table with 50 entries (users with such details like Name Surname Location
I have table with a unique auto-incremental primary key. Over time, entries may be
I have three tables. First table is Activities and second is Members and last
I have a table where I want to Log activities of some part of
I have the following model: activity_types: id, name activities: id, id_activity_type, occurrences, date (other
I have three activities 1 is the main activity 2 is some other activity
I have the following two tables activity(activity_id, title, description, group_id) statistic(statistic_id, activity_id, date, user_id,
I am creating an activity table with many types of activities. Let's say activities
I have two DB tables, ACTIVITY and USER . In the ACTIVITY table I
I have three table in the Database - Activity table with activity_id, activity_type Category

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.