Results 1 to 4 of 4
  1. #1
    Krypto3 is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2014
    Posts
    2

    Post Saving a daily generated query for later lookup by date?

    I have a query that reports the number of students that are currently enrolled in a given number of schools within an area for that given day that the query is ran. This number can fluctuate greatly day to day, so is there a way to create a table which can hold this information so that I can go back in history and look up what our numbers were on whatever given day (date). (The example below is just a representation of what I actually have.) The School number would be unique, as would the date (I assume), I would like to see all of our school on whatever given date to see what our numbers are or were. Thanks for any helpful advice.

    I have an example of the query currently I have set up in access 2007:



    School # School Name Qty Date

    001 BLUE 300 02/26/2014
    002 RED 468 02/26/2014
    003 YELLOW 10 02/26/2014


    VS

    School # School Name Qty Date
    001 BLUE 310 02/27/2014
    002 RED 400 02/27/2014
    003 YELLOW 8 02/27/2014

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Just apply date filter criteria to query or report.

    SELECT * FROM table WHERE [Date] = [enter date value];

    The [enter date value] input can be reference to textbox on form.

    SELECT * FROM table WHERE [Date] = Forms!formname!textboxname;

    Date is a reserved word. Should not use reserved words in naming convention.

    Also avoid spaces and special characters/punctuation (underscore is exception) in naming convention.
    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
    Krypto3 is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2014
    Posts
    2
    That wouldn't work for me as the query's date changes each day and is not stored currently, so the only date to look up would be the current day. I think I just figured it out though. I created a table from the query, I think made the query into an append query that I can run each day as the data changes, the append would add the data to the table just below the previous days numbers. I can then run a query off this table to run the example you just demonstrated. I think this would work for me. I will just have to run it everyday, so may I can create a macro to do it for me upon closing the database? another question for another forum post i guess. Thanks for the help June7.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    I don't understand that. Show the original query you are using. If you have a parameter in query for current date, there is a way to do that and still not need another table.

    I never build queries with dynamic parameters. I open filtered forms and reports.

    Another table should not be needed.
    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.

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

Similar Threads

  1. Daily Job List Query - Current Date Issue
    By iProRyan in forum Queries
    Replies: 5
    Last Post: 02-14-2014, 02:39 AM
  2. Replies: 3
    Last Post: 02-02-2011, 08:04 PM
  3. Date Lookup in Query for Junction Table
    By Phasma in forum Access
    Replies: 2
    Last Post: 01-21-2011, 03:36 PM
  4. Daily reports from date range tables?
    By sparker in forum Database Design
    Replies: 0
    Last Post: 03-29-2010, 11:07 AM
  5. From which query is the report generated
    By rukmal82 in forum Reports
    Replies: 6
    Last Post: 09-30-2009, 09:28 AM

Tags for this Thread

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