Results 1 to 4 of 4
  1. #1
    MTSPEER is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    283

    Count function of a Min function


    Hello,

    I want to find how many days there are of the oldest date in my table. The table name is tbl_Queue and the field name is Contract_Date. I'm not sure how to do this. I tried in the query design view for the field name:

    Count(Min(Format([tbl_Queue].[Contract_Date], "mm/dd/yyyy")))

    But it didn't work. Your help would be appreciated. Thanks

  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,529
    Shot in the dark:

    SELECT TOP 1 [Contract_Date], Count(*) As HowMany
    FROM
    [tbl_Queue]
    GROUP BY
    [Contract_Date]
    ORDER BY
    [Contract_Date]
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    MTSPEER is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    283
    I'm trying to create this in query design view and I want to get the latest date of each of each building which is a field..and how many times that date is in there for each building

  4. #4
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Try this:
    Code:
    SELECT tbl_Queue.Building, Max(tbl_Queue.Contract_Date) AS Max_Date, Count(tbl_Queue.Contract_Date) AS Total_Count
    FROM tbl_Queue
    INNER JOIN
    (SELECT tbl_Queue.Building, Max(tbl_Queue.Contract_Date) AS Max_Date
    FROM tbl_Queue
    GROUP BY tbl_Queue.Building) as tmp
    ON tbl_Queue.Building=tmp.Building AND tbl_Queue.Contract_Date=tmp.Max_Date
    GROUP BY tbl_Queue.Building;

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

Similar Threads

  1. Count Function Help
    By cbramsey in forum Queries
    Replies: 11
    Last Post: 03-23-2017, 09:21 AM
  2. Crosstab with sum and count function?
    By alibanks in forum Queries
    Replies: 1
    Last Post: 01-31-2015, 09:25 PM
  3. Count(*) function
    By FJM in forum Access
    Replies: 18
    Last Post: 09-13-2013, 07:47 PM
  4. COUNT Group Count Records COUNT FUNCTION
    By PMCOFFEY in forum Access
    Replies: 9
    Last Post: 11-09-2012, 09:40 PM
  5. Count + between + parameter function
    By teirrah1995 in forum Queries
    Replies: 3
    Last Post: 08-11-2011, 10:25 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