Results 1 to 9 of 9
  1. #1
    jfiresto is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Feb 2013
    Location
    California
    Posts
    7

    Count the number of records in results of a query

    I have a Table called Dates in this table I have three fields Date_ID, Customers and Date_1



    I have a query that sets the date range I am searching what I want also is to give me a count of the results from the query. I have attached a copy of my query in SQL I am using Access 2010. I hope this is clear as to what I want, I hope some one can help, I am lost at this. What do I need to add or change ?

    SELECT Dates.Date_1
    FROM Dates
    WHERE (((Dates.Date_1) Between [what start date:] And [What end date:]));


    Thanks in advance
    John

  2. #2
    Rod is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Location
    Metro Manila, Philippines
    Posts
    679
    Read up on DCount.

  3. #3
    jfiresto is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Feb 2013
    Location
    California
    Posts
    7
    I just read about DCount and now I am totaly confused as to what to do.

  4. #4
    Rod is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Location
    Metro Manila, Philippines
    Posts
    679
    How/where do you want to use/display the count?

  5. #5
    jfiresto is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Feb 2013
    Location
    California
    Posts
    7
    in a message box

  6. #6
    Rod is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Location
    Metro Manila, Philippines
    Posts
    679
    Actually I need the whole story: how do you invoke the query; are you going to run the query and get the count simultaneously; are the start and end dates known/stored somewhere or are they entered each time the query/count is run?

  7. #7
    jfiresto is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Feb 2013
    Location
    California
    Posts
    7
    Right now I will just select the Query and run it. The query will ask me to enter a start and end dates which I will enter. The query would then come back with the query/count.

  8. #8
    Rod is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Location
    Metro Manila, Philippines
    Posts
    679
    This will give you a count:

    SELECT Count(Date_1) AS CountOfDate1
    FROM Dates
    WHERE (((Dates.Date_1) Between [what start date:] And [What end date:]));

  9. #9
    jfiresto is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Feb 2013
    Location
    California
    Posts
    7
    Thank you so much, this was driving me crazy.

    Thank you
    John from California

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

Similar Threads

  1. Replies: 1
    Last Post: 01-24-2013, 05:50 PM
  2. Replies: 10
    Last Post: 09-21-2012, 09:00 AM
  3. Replies: 6
    Last Post: 07-25-2011, 01:54 PM
  4. count the number of records from a query
    By Nixx1401 in forum Queries
    Replies: 4
    Last Post: 05-24-2011, 06:45 PM
  5. Replies: 7
    Last Post: 07-22-2010, 01:14 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