Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2002

    Unanswered: Data type mismatch in criteria expression.

    I am using access 2000 database and getting the following error:

    Microsoft JET Database Engine (0x80040E07)
    Data type mismatch in criteria expression.

    The quiry is:
    "SELECT AffID, Date, Hits, Payment, Commission, Paid, Sum(Hits) AS HitsTotal, Sum(Payment) AS PaymentTotal, Sum(Commission) AS CommissionTotal, Sum(Paid) AS PaidTotal, Commission - Paid AS Balance from earned WHERE earned.Date Between #"& startDate &"# and #"& endDate &"# AND AffID='"& AffId &"' GROUP by AffID, Date, Hits,Payment, Commission, Paid order by Date ASC"

    Both AffID and Hits are number fields; Payment, Commission and Paid are currency fields; and Date is Date/Time field. While trying both AffID and date range get posted from the forms to the page having this script but still error is there. I tried hard but in vain. I would appreciate the help in getting rid of this error. Thanks

  2. #2
    Join Date
    Jan 2003
    Dont put quotes around your AffID in your where clause. your code should be "AND AffID=" & AffID & " Group by".......
    not "AND AffID='"& AffId &"' GROUP by"

    Just remove the single quotes

Posting Permissions

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