Hi,
My problem is related with the RecordSet.
i want to retrieve data from my table for specified period using some parameters, like
1) stock number
2) product number,
3) and between some user define period.
At the starting part of my code every veriable is defined.
R - is a Recordset
start_date and end_date - is a Define by User
--here is the small part of my code where i have problem, i only have problem with this statment when i try to use the Date field from my table and want to retrieve records between specified period. the format of date field is set to a short date in both table and form.
here is the statements,
1)
---------------
Set R = dbs.OpenRecordset("select * from jrn where (stock = 6)and (productcode = 214)and
(jrdate > Me!start_date) and (jrdate < Me!Me!end_date)", dbOpenDynaset)
-----------------
i try to do it in another way,
2)
-------------
Set R = dbs.OpenRecordset("select * from jrn where (stock = 6)and (productcode = 214)and
(jrdate) Between Me!start_date and Me!end_date", dbOpenDynaset)
--------------
in both the statments i got the error saying like
(Run Time Error 3061
Too few parameters required 2).
Please guide me where i'm doing wrong, thanks in advance.
My problem is related with the RecordSet.
i want to retrieve data from my table for specified period using some parameters, like
1) stock number
2) product number,
3) and between some user define period.
At the starting part of my code every veriable is defined.
R - is a Recordset
start_date and end_date - is a Define by User
--here is the small part of my code where i have problem, i only have problem with this statment when i try to use the Date field from my table and want to retrieve records between specified period. the format of date field is set to a short date in both table and form.
here is the statements,
1)
---------------
Set R = dbs.OpenRecordset("select * from jrn where (stock = 6)and (productcode = 214)and
(jrdate > Me!start_date) and (jrdate < Me!Me!end_date)", dbOpenDynaset)
-----------------
i try to do it in another way,
2)
-------------
Set R = dbs.OpenRecordset("select * from jrn where (stock = 6)and (productcode = 214)and
(jrdate) Between Me!start_date and Me!end_date", dbOpenDynaset)
--------------
in both the statments i got the error saying like
(Run Time Error 3061
Too few parameters required 2).
Please guide me where i'm doing wrong, thanks in advance.