I'm trying to update 2 different tables with an update query as shown below
UPDATE db1.table1 a, db2.table1 b
SET b.firstname = a.firstname,
b.lastname = a.lastname,
b.address = a.address,
b.state = a.state,
b.city = a.city,
b.zip = a.zip
WHERE a.stud_id=b.stud_id AND a.firstname IS NOT NULL AND b.firstname IS NULL
AND str_to_date(a.joindate,'%m/%d/%Y') >= str_to_date('02/01/2012','%m/%d/%Y');
but when i tried to execute this query, MySQL kept throwing the following error
Error Code: 1292. Truncated incorrect DOUBLE value: 'CROUGH0000'
Though i've found much similar posts in stackoverflow, i couldn't find the exact solution to this problem.
Need some help. Thanks in advance
EDIT : Datatypes of each column are as follows
b.firstname(varchar(25)) = a.firstname(varchar(52)),
b.lastname(varchar(25)) = a.lastname(varchar(35)),
b.address(varchar(40)) = a.address(varchar(50)),
b.state(char(2)) = a.state(char(2)),
b.city(varchar(25)) = a.city(varchar(25)),
b.zip(varchar(11)) = a.zip(varchar(11))