Results 1 to 2 of 2
  1. #1
    athyeh is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2013
    Posts
    170

    Query Grouping Help


    Hi Folks,

    e.g.
    [User ID]: xxx01; [Status]: Incomplete; [Timestamp]: 11/01/2011 12:01:00.
    [User ID]: xxx02; [Status]: Incomplete; [Timestamp]: 11/01/2011 14:30:00.
    [User ID]: xxx03; [Status]: Complete; [Timestamp]: 11/01/2011 15:11:00.
    [User ID]: xxx04; [Status]: Complete; [Timestamp]: 12/01/2011 17:12:00.

    I am trying create a query that lists the number of users at each status for each date.

    e.g. for the record above, I would like the query to return:
    [Date]: 11/01/2011; [Status]: Incomplete; [CountOfUser ID]: 2.
    [Date]: 11/01/2011; [Status]: Complete; [CountOfUser ID]: 1.
    [Date]: 12/01/2011; [Status]: Complete; [CountOfUser ID]: 1.

    As you can probably tell, the problem is when the query is run the date/time field is grouped as dd/mm/yyyy hh:mm:ss .

    Is there a way I can group this field as dd/mm/yyyy without having to change datatype in the table?

    DateValue([TimeStamp]) returns error: "Expression to complicated"


    Thanks in advance for any help you can give.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,648
    Try:

    SELECT Status, Format(Timestamp, "mm/dd/yyyy"), Count([User ID]) AS CountUser GROUP BY Status, Format(Timestamp, "mm/dd/yyyy");
    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. Grouping query with percentage
    By msadiqrajani in forum Queries
    Replies: 1
    Last Post: 03-16-2012, 02:14 PM
  2. IIF Grouping Query Problem
    By cbh35711 in forum Access
    Replies: 1
    Last Post: 03-16-2012, 07:10 AM
  3. typical query on grouping
    By johnbest in forum Access
    Replies: 2
    Last Post: 03-13-2012, 10:36 PM
  4. Creating a Grouping query
    By Dev in forum Access
    Replies: 4
    Last Post: 09-02-2010, 06:46 AM
  5. Grouping query
    By Mphiri in forum Programming
    Replies: 10
    Last Post: 06-15-2010, 08:58 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