Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    McArthurGDM is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    215

    The problem with that code seems to be the fact that the Quarter information comes from a table called "Main" and the Project information from a table called "Info". Since they come from two different tables - which are linked via "MainID", can I make duplicates of each in the same manner and have it work?

  2. #17
    McArthurGDM is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    215
    Click image for larger version. 

Name:	DateChange.jpg 
Views:	10 
Size:	117.8 KB 
ID:	20718

    Here is what the table structure looks like.

    I am concerned with the fields Info.Initiative_ID (Projects), Info.Start_Date, Info.End_Date, Main.CalcSort (I assigned numerical values for the period).

    The code you gave me dosen't work because you, I think, assumed that the Projects field was on the same table as the CalcSort field.

    Thanks,

  3. #18
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Appears to be circular reference, review: http://www.codeproject.com/Articles/...atabase-Design

    Why are there no primary key fields defined?
    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.

  4. #19
    McArthurGDM is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    215
    That's correct. Take away the link from the Main table to the Initiative table and now it gives me the correct amount. Still the same issue with the code, though. Thanks for pointing that out.

  5. #20
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    Which table has the 'main' date, the date for which you want to find the maximum date lesser than? What is the field name of that date field?

    Which table has the 'sub' date, the date for which you want to find the maximum value that is also under the 'main' record? What is the field name for that date field?

    Can either table have activity for the same Main_ID on the same day or is there only one record per day per Main_ID.

  6. #21
    McArthurGDM is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    215
    Click image for larger version. 

Name:	484848.png 
Views:	4 
Size:	26.9 KB 
ID:	20733

    I changed a few things around from the last picture I posted.

    I should probably explain better what all this is.
    Assume you have a list of projects (Initiative_ID's) and progress on those projects is submitted every period (month/quarter - which I designate by CalcSort). The person submitting information about a project specifies that they believe the project has a Start_Date of whenever and an End_Date of whenever. Over each period they submit the status of that project, the Start_Date and End_Date can change based on what they believe could happen. But I want to note, if over a period, they changed the Start_Date or End_Date.

    The query should really only be dependent on 4 fields. The initiative_ID field which comes from the Initiative table, the CalcSort field which comes from the Main table (these are just numbers that I allocated to months, 1-12, and quarters, 1-4, instead of a text field), the Start_Date and End_Date fields come from the Info table.

    Here is an example (subset) of the output and the desired highlight. I want a field to indicate when a Start_Date or End_Date has changed over time given a particular Initiative_ID.


    Initiative_ID CalcSort Start_Date End_Date
    15-US CO-33 3 9/1/2015 10/31/2015
    15-US CO-33 3 9/1/2015 10/31/2015
    15-US CO-34 0 1/1/2015 3/31/2015
    15-US CO-34 1 1/1/2015 5/20/2015
    15-US CO-34 2 1/1/2015 6/15/2015
    15-US CO-34 3 1/1/2015 6/15/2015
    15-US CO-34 3 1/1/2015 6/15/2015
    15-US CO-35 0 2/1/2015 12/31/2015
    15-US CO-35 1 2/1/2015 12/31/2015
    15-US CO-35 2 2/1/2015 12/31/2015

    Let me know if that makes sense or not,

    Thanks!
    Attached Thumbnails Attached Thumbnails 484848.png  

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 07-15-2014, 12:00 PM
  2. Replies: 1
    Last Post: 07-14-2014, 10:45 PM
  3. Notification / alerts for data change
    By engr_saud1 in forum Access
    Replies: 1
    Last Post: 06-05-2013, 05:57 AM
  4. query notification
    By imintrouble in forum Queries
    Replies: 3
    Last Post: 01-18-2012, 10:00 AM
  5. Replies: 1
    Last Post: 12-15-2011, 08:47 AM

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