Results 1 to 3 of 3
  1. #1
    jon6035 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2011
    Location
    California
    Posts
    12

    Inclusive dates for event

    I trying to develop an event tracker.



    In the events table I have:
    [Events].[PKEvents] as Autonumber
    [Events].[EventName] as Text
    [Events].[StartDate] as Date
    [EndDate] as Date.

    I then have a related table, where I store a many-to-many link to a personnel table.

    [MMEventtoPersonnel].[PKMMEventtoPersonnel] as Autonumber
    [MMEventtoPersonnel].[FKEvents] as Number
    [MMEventtoPersonnel].[FKPersonnel] as Number (Dual Primary key on FKEvents and FKPeronnel.)

    So that for one event, I might have 5 people assigned and for another I might have 10.

    Eventually, I have to provide a percentage of available manning for each day, by section, but before that I have to figure out how to list the inclusive dates between the start and end. I have searched, but don't think I am asking the question right. So I have the basic table (which I created from a query) in the attached db, I also included a spreadsheet for how I envision the output to appear in an actual query.

    Eventually, everything will be passed to the query from a form parameter, so that it continues to be dynamic.

    Any thoughts?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Wasn't this resolved with thread https://www.accessforums.net/queries...rim-17497.html

    You want to input a start and end date and return event records where the event starts and ends within the given dates? Try:
    SELECT Event, [Personnel Name], StartDate, EndDate, [Input start date] AS Start, [Input end date] AS [End]
    FROM Events
    WHERE ((([Input start date])<=[StartDate]) AND (([Input end date])>=[EndDate]));
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    jon6035 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2011
    Location
    California
    Posts
    12
    It is solved. But not by the other thread. I needed to reset start and end dates dynamically, without user input for both values, and without them being able to choose more than 33 days. I built a bunch of sub queries to get it done.

    Thanks for your help again.

    But I will definitely use your syntax below.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Help on an event...
    By allykid in forum Forms
    Replies: 4
    Last Post: 03-15-2011, 11:25 AM
  2. display all dates between two dates
    By KenThompson in forum Access
    Replies: 8
    Last Post: 02-23-2011, 01:11 PM
  3. Mixed dates - show only complete dates?
    By weeblesue in forum Queries
    Replies: 3
    Last Post: 10-27-2010, 02:15 PM
  4. Replies: 9
    Last Post: 10-01-2010, 05:50 PM
  5. Replies: 21
    Last Post: 06-03-2009, 05:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums