Results 1 to 3 of 3

Thread: Getting a count of specified records in a query

  1. #1
    Join Date
    Jun 2004
    Location
    Edmonton Alberta
    Posts
    19

    Getting a count of specified records in a query

    I have a query that calculates the date difference between an expiry date and todays date using DateDiff("d",Date(),[AccredExpiryDate]).

    I need to get a current count of the number of records in a specific range, i.e. a count of the number of records that are between 0 and 90 days, over 90 days, and less than 0 days (expired) etc.

    Any assistance would be greatly appreciated.

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    On which db system? T-sql should like:

    select count(*) from tab where DateDiff(d, AccredExpiryDate, getDate()) < ...

  3. #3
    Join Date
    Jun 2004
    Location
    Edmonton Alberta
    Posts
    19
    My apologies for not including the database type. It is actually MS Access. I have since come up with a workable solution using the DCount() function within my form and report.

    Thanks for getting back to me. Much appreciated.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •