I have a problem using 'like' clause in MySQL 5.0 I have written a stored procedure in MySQL 5.0 and calling the Stored Procedure from my Java Program the stored procedure below in the select statement i want to take the value of parameter departmentname for like clause please Help with this
DROP PROCEDURE IF EXISTS upSelTests;
DELIMITER //
CREATE PROCEDURE upSelTests
(
IN departmentname varchar(50),
IN testDateFrom varchar(10),
IN testDateTo varchar(10)
)
BEGIN
declare testDateFrom1 varchar(30);
select PatientID,LabNo,arriveddate,RecieptNo,patientname,referredby,ID from
tblAcceptTest where STR_TO_DATE(arriveddate, '%d/%m/%Y')>=STR_TO_DATE(testDateFrom,
'%d/%m/%Y') and STR_TO_DATE(arriveddate, '%d/%m/%Y') <= STR_TO_DATE(testDateTo,
'%d/%m/%Y') and Status = 0 and DeptName like '%departmentname%';
END //
DELIMITER ;