Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2002
    Location
    Mpls/St.Paul area
    Posts
    303

    Post Unanswered: DCount - are DCount and 'Distinct' incompatible?

    I would like to use 'Distinct' in the DCount criteria.

    If i am correct the function works like this...
    DCount(expr, domain[, criteria])
    where the criteria is optional and the syntax is like the 'where' statement of an SQL without the word 'where'.

    I would like to have the criteria chose distinct records. For example, give the number of cities in North Dakota that have had temperatures over 90 degrees this summer. A city may have had several days over 90 degrees, but I only want to count it once.

    Gurus of Secret Syntax have any ideas?
    John
    This is the day the Lord has made, I will rejoice and be glad in it.

  2. #2
    Join Date
    Feb 2002
    Posts
    403
    You could base your dsum on a query to work like this.

    Dsum("[Cities]","[qryOver90]")

    Or alternatively write the SQL code directly into code and not use dsum at all.

    HTH

  3. #3
    Join Date
    Jun 2002
    Location
    Mpls/St.Paul area
    Posts
    303
    I wanted to avoid making queries so as you suggested, I ended up writing the SQL statement directly into code creating a recordset and then getting the count from that.

    Thanks for the input!
    John
    This is the day the Lord has made, I will rejoice and be glad in it.

Posting Permissions

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