I have this query:
SELECT * FROM table_1 WHERE (`update_column` = (DATE_SUB(curdate(), INTERVAL 10 DAY)))
It works normally, I want to change 10 day to parameter and pass value of it through adapter, I'm using query builder, with query in adapter:
FillBy_sub_date
Which i want to be like:
SELECT * FROM table_1 WHERE (`update_column` = (DATE_SUB(curdate(), INTERVAL @_days DAY)))
And i want to pass day value with the following method:
Me.table_1Adapter.FillBy_sub_date(Me.dataset.table_1, 5)
5 is the number of day which i wont to pass to query
Problem: when i change number 10 to @_days mysql error showing
Error in list of function arguments: '_days' not recognized. Unable to parse query text.
there is more then one way , first create procedure in your mysql database with parameter let call it "return_after_some_days" your query is correct so put it inside procedure
create procedure
CREATE PROCEDURE return_after_some_day (in param1 INT)
BEGIN
SELECT * FROM `table` where `update_column` = (DATE_SUB(curdate(), INTERVAL param1 day ));
end;
then go to your builder wizard and add query to table adapter
Me.table_1Adapter.name_of_method_that_call_procedure(Me.dataset.table_1, 5)
number 5 will be pass to proceuder