Results 1 to 8 of 8
  1. #1
    zylosan is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Posts
    17

    How do you set a quary to only display data after a given date.


    I have a large table of data records. Each has a date field. I want to build a quary that only displays records with a date after XX/XX/xxxx. I figure that it should go in the criteria spot on the design view of the quary but don't know syntax.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    >#XX/XX/xxxx#
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Assuming your data type is Date and not Text, just use the pound signs as your date qualifier, i.e.
    Code:
    > #11/10/2012#

  4. #4
    zylosan is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Posts
    17
    To clarify,

    I am attempting to make a aggregate query that displays the average for each field in the table. I would like to be able to delimit some of the records (i.e. those before a given testing date) from the records that are averaged. I can do it by creating a sub-query that pulls up all the data records based on the date and than running an aggregated query on that. Is there any way to do it directly in my aggregated query?

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Have you tried the above? Including a date criteria should exclude those records.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    zylosan is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Posts
    17
    I am using the totals bar on the query design view page. It does not work with out a value in the totals box but if I choose group by it displays each set of records that fall on a given date rather than the average of all the dates falling after that date.

  7. #7
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    For your criteria field, choose the value of "WHERE" on the Totals line. Then it only uses it for selection purposes, and does not group by it.

  8. #8
    zylosan is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Posts
    17
    Thank you much. Problem solved.

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

Similar Threads

  1. Replies: 3
    Last Post: 08-21-2012, 03:05 PM
  2. Date Entry in one format display in another
    By mikethebass in forum Forms
    Replies: 1
    Last Post: 01-22-2012, 05:34 PM
  3. Display Most Recent Date
    By jsimard in forum Queries
    Replies: 2
    Last Post: 06-23-2011, 02:44 PM
  4. How to display year season from date entry
    By Allaw212 in forum Access
    Replies: 3
    Last Post: 06-01-2010, 11:11 AM
  5. Replies: 2
    Last Post: 02-20-2010, 01:11 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