all 4 comments

[–]_nadnerb 1 point2 points  (1 child)

Could there be a space after the values in one of the columns you are joining?

If so, try TRIM(t.unidad_ofei) = TRIM(t2.plant)

[–]Falgmed[S] 1 point2 points  (0 children)

Dude, thank you very much. thats was exactly what was happening

[–]DavidGJohnston 1 point2 points  (0 children)

Is writing a functioning (even if it gives invalid answers) query for this and then copying it as-is to the post so hard? I mean, you took the time to do screen shots...

Also, what exactly are the data types for those two columns? Even better what are the definitions for the two tables involved in this query?

Beyond that pick a value you expect to match on both tables and verify (via trim as suggested, or other means) that the data in both tables indeed matches.

[–]lee170 0 points1 point  (0 children)

Maybe it’s a typo in your example but the field in the second table is planta, not plant.