People that know SQL - Help please!
if you break it apart does it work? Like, do the select first, then if that returns fine, run it w/ the join etc....dunno if you did this, but I always build outward. Also, i've gotten in the habit of using DB.dbo.table, like grifter said.
Try that.
If it still craps out, try switching the order of the tables
Code:
SELECT (e.emp_fname ||' '|| e.emp_lname) Pilot, p.pil_pt135_date, e.emp_hire_date FROM hartmar.employee e JOIN hartmar.pilot p ON e.emp_num = p.emp_num WHERE p.pil_license = '&my_pilot_license_type' ORDER BY Pilot;
Code:
FROM hartmar.pilot p JOIN hartmar.employee e ON p.emp_num = e.emp_num
Try that.
If it still craps out, try switching the order of the tables
Code:
SELECT (e.emp_fname ||' '|| e.emp_lname) Pilot, p.pil_pt135_date, e.emp_hire_date FROM hartmar.employee e JOIN hartmar.pilot p ON e.emp_num = p.emp_num WHERE p.pil_license = '&my_pilot_license_type' ORDER BY Pilot;
Code:
FROM hartmar.pilot p JOIN hartmar.employee e ON p.emp_num = e.emp_num



h: