Results 1 to 5 of 5

Thread: dcount (97 2)

  1. #1
    2 Star Lounger
    Join Date
    Aug 2002
    Location
    New Jersey, USA
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    dcount (97 2)

    Can you please tell me the correct syntax for this statement.

    RptDate = Mid(MyInpStr, 63, 6)
    RecCt = DCount("[date_processed]", "Tbl:Processed_Date_Log", "[Date_Processed] = "RptDate")

    I am having problems with the criteria. The RptDate on the first line is correct but it is not picking up any records from the table in the dcount expression

    I am not sure how to code this criteria.

    Thanks
    Cathy

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: dcount (97 2)

    What kind of field is Date_Processed? A date field, a text field or a number field?

  3. #3
    2 Star Lounger
    Join Date
    Aug 2002
    Location
    New Jersey, USA
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: dcount (97 2)

    Date_Processed is a text field

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: dcount (97 2)

    Try this:
    <code>
    RecCt = DCount("[date_processed]", "Tbl:Processed_Date_Log", "[Date_Processed] = " & Chr(34) & RptDate & Chr(34))
    </code>
    The Chr(34)s insert quotes into the WhereCondition string.

  5. #5
    2 Star Lounger
    Join Date
    Aug 2002
    Location
    New Jersey, USA
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: dcount (97 2)

    Thank you so very much!!!!!

    Again you have saved me hours of frustration.

Posting Permissions

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