Results 1 to 4 of 4
  1. #1
    ecoman007 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Posts
    2

    Show Date Action First Appeared

    I poked around for something I could use but haven't been able to find anything.



    Here's my dilemma - I retrieve a certain report each week which I track on an annual basis.

    Currently, I indicate if an action on the report was on the previous week's report (simple VLOOKUP).

    My goal is to load the report data into an Access 2010 table each week (each report will have a column with the date the report was run ("Date Appeared")).

    I then want to create a query to give me two things:

    1. All of the actions with the most current report date
    2. A column that shows the first time each action first appeared (if it is a "repeat offender")


    I have attached an Excel file of what I will be loading into the database (this is the initial upload with all previous week's data...the week to week reports will only have actions for that week). All fields in the spreadsheet will be in the Access table.

    I am not opposed to coding it but I am a novice and would need hand-holding

    Thanks in advance
    Attached Files Attached Files

  2. #2
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    I think you're looking at 2, maybe 3 queries.
    1. would be a Totals query, grouped by action, calculating the Max of date field
    2. would be a Totals query, grouped by action, calculating the Min of date field, but based on your flag column because you wrote
    I indicate if an action on the report was on the previous week's report
    If all you did to create that indicator was to format the text, then I don't know (sorry, I didn't download your sample - yet).

    Then a query that connects the two. I could be wrong (as is often the case), but I don't see how you can have both Min and Max aggregate functions on the same grouping in one query. If anyone can do this with a sub query, I'm sure they'll chime in. I don't have a lot of success attempting those.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Unless I misunderstand what you mean, Micron, seems to me can do.

    SELECT [group field], Max([data field]) AS MaxData, Min([data field]) AS MinData, Sum([data field]) AS SumData, Avg([data field]) As AvgData FROM tablename GROUP BY [group field];

    Determining "if an action on the report was on the previous week's report" is the complication in this process and calls for a subquery or domain aggregate.
    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. #4
    ecoman007 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Posts
    2
    Micron & June7: First, my apologies for my lack of response. Second, you guys are awesome! I see you on many of the posts when I am researching other issues and your guidance is top notch! Lastly - thank you both for your replies to my question. Combined, I was able to successfully create the report I was looking for!

    My base goal was to find the date each action first appeared. With your guidance, I created the query below and it is working great! I have reattached the initial report I was working from for my database model.

    SELECT Min([Unclosed Master Table].[Date Appeared]) AS [First Appeared on Report], [Unclosed Master Table].[PO]
    FROM [Unclosed Master Table]
    GROUP BY [Unclosed Master Table].[PO];

    Again - thank you!
    Attached Files Attached Files

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

Similar Threads

  1. Replies: 4
    Last Post: 08-25-2016, 04:19 PM
  2. Replies: 3
    Last Post: 03-28-2016, 05:59 PM
  3. Replies: 2
    Last Post: 01-11-2015, 11:45 PM
  4. Replies: 3
    Last Post: 09-02-2014, 06:45 PM
  5. Replies: 7
    Last Post: 03-08-2013, 02:13 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