Ah, I figured it out...
Data type mismatch when querying Tax ID
Darrell Burns
141
Reputation points
I've created a simple query to look up customers by Tax ID. Since the users don't always insert the hyphens in the right place, I strip out the hyphens using the REPLACE function. But the query throws a Data Type Mismatch error (see example). I've tried converting the stripped TIN with CSTR and CDBL, but to no avail.
Anybody have any ideas?
Accepted answer
-
Darrell Burns 141 Reputation points
2021-01-31T14:32:31.85+00:00
2 additional answers
Sort by: Most helpful
-
Bruce H 1 Reputation point
2021-01-26T18:30:09.173+00:00 What is the datatype of TIN in your table? If it is a long integer, try Clng(Replace(...))
-Bruce -
Darrell Burns 141 Reputation points
2021-01-27T12:33:42.427+00:00 It's a string. It couldn't be numeric with hyphens in it.