Results 1 to 3 of 3
  1. #1
    scorpiogray is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    May 2013
    Posts
    2

    Query list of clients in date range

    This question may have been asked already so I apologize if I am repeating.



    I work for a place that has clients who make multiple visits in a month. I need a query that will show me who has been active in a date range without displaying all of the persons visit dates. Currently this is the SQL strring;

    SELECT [CHS-INTAKE].[Participant first name], [CHS-INTAKE].[Participant last name], [CHS-INTAKE].[Related Record1], [CHS-INTAKE].[Related Record2], [sup-parent-detail].[sup-sched-date], [sup-parent-detail].[sup-compl-date]
    FROM [CHS-INTAKE] INNER JOIN [sup-parent-detail] ON [CHS-INTAKE].[Participant no] = [sup-parent-detail].[Participant no]
    WHERE ((([sup-parent-detail].[sup-sched-date])>=[begin date] And ([sup-parent-detail].[sup-sched-date])<=[end date]) AND (([sup-parent-detail].[sup-compl-date])>=[begin date] And ([sup-parent-detail].[sup-compl-date])<=[end date]));

    and i get results like this;

    Participant first name Participant last name Related Record1 Related Record2 sup-sched-date sup-compl-date
    John Doe Jane Doe
    4/14/2013 4/14/2013
    John Doe Jane Doe
    4/7/2013 4/7/2013
    John Doe Jane Doe
    4/28/2013 4/28/2013
    John Doe Jane Doe
    4/21/2013 4/21/2013

    Where it does give me the name of the client but multiple times because they had multiple visits in the month. All I want is for it show the client's name and related name once in the active date range.

    Please help.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,753
    Can do a GROUP BY (Totals) query that uses the date field in the criteria but does not display the field. Open the query in design view and select Totals from menu. Under the date field, set WHERE on the Total row and uncheck Show.

    Or use DISTINCT parameter in the query, do same as above with the date fields.
    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
    scorpiogray is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    May 2013
    Posts
    2
    Quote Originally Posted by June7 View Post
    Can do a GROUP BY (Totals) query that uses the date field in the criteria but does not display the field. Open the query in design view and select Totals from menu. Under the date field, set WHERE on the Total row and uncheck Show.

    Or use DISTINCT parameter in the query, do same as above with the date fields.
    Thank you, that worked exactly the way I wanted it. I new it was something going to be simple but I just don't know that much about Access.

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

Similar Threads

  1. Replies: 9
    Last Post: 02-12-2013, 03:14 PM
  2. Date Range Query
    By need_help12 in forum Queries
    Replies: 7
    Last Post: 04-25-2012, 01:38 PM
  3. Run query by date range
    By ARickert in forum Access
    Replies: 2
    Last Post: 06-23-2011, 10:54 AM
  4. Complicated Query needs some date range help
    By KevinMCB in forum Queries
    Replies: 1
    Last Post: 01-11-2011, 12:25 PM
  5. Query for date range from two column?
    By sunny in forum Queries
    Replies: 2
    Last Post: 07-28-2010, 07:12 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