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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem selecting data from two tables when column names are different

Status
Not open for further replies.

NIGHTRUNNER

Programmer
Apr 21, 2000
2
0
0
US
Problem: When selecting data from two database tables only one tables data is being selected. I believe my SQL statement is correct as I have run the same statement in the Crystal SQL designer and get good data there.<br>This problem only seems to occur when the columns I am joining between the two tables are of not the same name.<br>Running Crystal 7.0<br>Accessing an Informix database.<br><br>Sample of SQL statement that does not work.<br>SELECT t_station.plac, t_mod.group_name FROM t_station, t_mod WHERE t_station.mod_id=t_mod.group_id<br><br>Sample of SQL statment that does work<br>SELECT t_user.id_1, t_profile.name FROM t_user, t_profile WHERE t_user.id_1=t_profile.id_1
 
Check your datatypes and make sure they are the same for the columns being joined. And remember that null does not equal null.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top