Hi,
I have the foll statement that is currently giving a "no records found " error although I have about 20 that match .
I have trouble with Joins and I suspect its the way this has been formed thats throwing up the error.
Issues to contend with :
a. The Customerid field in VisitReport is a varchar one ( it has data like 200,123,56 or 1,45 or just ,,, if the user has preferred to leave the field blank)
b. As a result, i cannot use the "=" to work while matching the customerids of the 2 tables.
c. The purpose of this sql is to list all records in VisitReport where atleast 1 customerid will match a customerid in CustomerList
d. Example : If ABC Corp, having customerid 1 in the CustomerList table appears in a record of VisitReport which has customerid 1,67,209 , then ABC Corp should get listed as having matched the criterion of appearing in Visit Report.
e. Would greatly appreciate advise on how I could rectify the sql below.
Thanks: Swati
$sqlb = "SELECT `Customers_List`.* FROM `Customers_List`
LEFT JOIN `VisitReport` ON `Customers_List`.Customerid LIKE `VisitReport`.Customerid
WHERE `Visit_Report`.Product LIKE '$name%'";