Enthu
Enthu

Reputation: 339

DSUM - Data Typed Mismatched in Criteria Expression

Withdrawal: DSum("[quantity]","Withdrawal","[part_number]= '&[part_number]&'")

I am getting the above error due to the statement above.

I have an Orders table, would like to collate and display the withdrawals quantity for each part number. Data type is number, am I missing anything here?

Your help is much appreciated.

Upvotes: 0

Views: 355

Answers (2)

Erik A
Erik A

Reputation: 32642

You're working with 2 types of quotes, and doing it improperly. The proper code should be:

Withdrawal: DSum("[quantity]","Withdrawal","[part_number]= " & [part_number])

In the code above, the second [part_number] was still inside a string so not filling properly. As a result you were comparing part numbers with the string [part_number]

Upvotes: 1

June7
June7

Reputation: 21370

Missing a quote after the first apostrophe and before the second.

Withdrawal: DSum("[quantity]","Withdrawal","[part_number]= '" & [part_number] & "'")

part_number is a text field? If not, remove the apostrophes.

Upvotes: 0

Related Questions