Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data type mismatch (Again)

Status
Not open for further replies.

PureSlate

MIS
Oct 25, 2010
34
US
I think I am cursed with this problem. Again I am having an issue with a query refusing to run due to a data type mismatch.

All related fields appear to be set to text, with a field limit of 255. Currently the fields I want to update are all Null, while the fields I am pulling from are, obviously, not.

My problem is that, even when simplifying the query to it's bare minimum, I still get this error.

SQL:

UPDATE TB LEFT JOIN [PBC-ChartOfAccounts]
ON TB.GLAcct = [PBC-ChartOfAccounts].Main_Account
SET TB.AcctDescr = [PBC-ChartOfAccounts]![Name];

Any help would be greatly appreciated.
 
I'd not use a LEFT JOIN for such UPDATE query:
UPDATE TB [!]INNER[/!] JOIN [PBC-ChartOfAccounts]
ON TB.GLAcct = [PBC-ChartOfAccounts].Main_Account
SET TB.AcctDescr = [PBC-ChartOfAccounts].Name
[!]WHERE TB.AcctDescr IS NULL[/!]


Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi PHV, thank you for the quick response.

I actually had that were clause before, and wasn't using a left join. (I had played around with the join settings to see if that was it before.)

I attempted to run the SQL you posted anyway, and encountered the same error.

Any other ideas?
 
I have solved the problem: The data type mismatch was caused by the key having different data types in the two tables.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top