Results 1 to 3 of 3
  1. #1
    jj1 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    128

    Post Difficulty getting correct data ---Running a Report

    I am trying to run a report showing 3 things
    Name of employee
    Start date of open issue
    Days since the issue is open (For calculating days I am using formula =DateDiff("d",[Start Date],Now())
    and my query is

    SELECT [Form].[Employee Name], Count([Form].[Completed By]) AS [CountOfCompleted By], [Form].[Start Date]
    FROM [Form]


    WHERE ((([Form].[Close Date]) Is Null))
    GROUP BY [Form].[Completed By], [Form].[Start Date]
    HAVING ((([Form].[Completed By]) Is Not Null) AND ((Count([Form].[Completed By])) Is Not Null))
    ORDER BY [Form].[Completed By];

    But my problem is my query gives employees name duplicate times

    so my data looks as this
    Name Start Date Days issue open
    John 2/2/2014 2
    John 3/2/2014 4
    John 4 /2/2014 6

    Where is I want employee name to appear once with maybe total number of days
    John 2/2/2014 6

    Showing start date is not required in the report.

    I tried doing where condition for start date and then query gives me correct data as in
    John 2/2/2014 6
    However as start date is where doesn't show up on report and thus no calculation days issue open.

  2. #2
    burrina's Avatar
    burrina is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    Check your query Property Sheet Values.

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Can't include [Start Date] in the SELECT clause. Or must wrap it into a function such as: Min([Start Date]) As FirstStart

    That SQL should error because Employee Name is not in GROUP BY or an aggregate expression. Shouldn't the GROUP BY be grouping on Employee Name instead of Completed By and Start Date?

    You have a table named Form? That is not good naming convention.

    Also should 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.

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

Similar Threads

  1. Replies: 2
    Last Post: 10-01-2014, 02:05 AM
  2. Replies: 5
    Last Post: 09-12-2014, 06:41 AM
  3. Listing correct data in a field
    By Lois in forum Forms
    Replies: 1
    Last Post: 10-18-2011, 12:09 PM
  4. Replies: 9
    Last Post: 06-26-2011, 09:14 PM
  5. not correct running total in group
    By cmk in forum Reports
    Replies: 1
    Last Post: 12-06-2006, 05:56 PM

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