simple mysql procedure, not working correctly
so i'm trying to create this procedure:
DELIMITER |
CREATE PROCEDURE test(IN start_date INT(8), IN end_date INT(8), IN test_code INT(4))
BEGIN
SELECT COUNT(*) FROM TABLE WHERE TEST_CODE = test_code AND DATE(`RELEASE`) BETWEEN start_date AND end_date;
END |
for some reason i'm having issues with the test_code variable part.
no matter what i put in there i get the same result. if i change the start_date or end_date my count changes.
what am i doing wrong?
thanks
Joe
edit: turns out that the veriable and column name can not be the same, i thought they were case sensitive, but i guess not.
Last edited by Eppo; 09-27-2011 at 03:08 PM.
|