Results 1 to 3 of 3
  1. #1
    Madmax is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    80

    query help with parameters

    I currently have a query that runs a start date and end date in it for numbers on testing. Trying to see if there is a way to restrict it to where I only get one record per CACID(different field) for that date period. I cant figure a way to do it.

  2. #2
    ssanfu is offline Master of Nothing
    Windows 2K Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Quote Originally Posted by Madmax View Post
    I currently have a query that runs a start date and end date in it for numbers on testing. Trying to see if there is a way to restrict it to where I only get one record per CACID(different field) for that date period. I cant figure a way to do it.
    Really hard to give a good answer without seeing the query, but if you have parameters for the two dates AND the CACID field, switch to SQL view and add the "TOP" predicate. It might look something like:

    "SELECT TOP 1 Date1, Date2, ....."

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Check out Allen Browne's Top N Records Per Group at http://allenbrowne.com/subquery-01.html
    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. Query with multiple parameters
    By Knaabis in forum Access
    Replies: 2
    Last Post: 06-30-2011, 01:15 AM
  2. Passing parameters to a query
    By stephenaa5 in forum Queries
    Replies: 3
    Last Post: 09-10-2010, 05:32 PM
  3. Msgbox in a query with parameters
    By seb in forum Forms
    Replies: 7
    Last Post: 07-06-2010, 05:07 AM
  4. Replies: 3
    Last Post: 07-01-2010, 07:55 PM
  5. Query NOT taking the two parameters WHY?
    By iamraja5 in forum Forms
    Replies: 7
    Last Post: 03-16-2010, 04:29 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