M
meter_man
I have a db that holds many SQL statements in a memo feild. These SQL
statements can have STARTDATE and ENDDATE parameters, however they are
currently stored as plain SQL with the dates written in.
How should I save the code with the STARTDATE and ENDDATE parameters so I
can then open a form, select a query, fill in the dates (if required) and
run the SQL? i.e. How should the SQL read?
I'm Guessing
1) save Code as : "Select * from table where PostDate >= |STARTDATE| and
PostDate < |ENDDATE|"
2) Set mySQL = SQLfield where record is selected on form.
3) Replace |STARTDATE| with form's Start Date and |ENDDATE| with form's End
Date using a find/replace function? (I need help here.)
4) docmd.Execute mySQL
Since I'm new. I wanted to run this theory past you kind folks.
Thanks
meterman
statements can have STARTDATE and ENDDATE parameters, however they are
currently stored as plain SQL with the dates written in.
How should I save the code with the STARTDATE and ENDDATE parameters so I
can then open a form, select a query, fill in the dates (if required) and
run the SQL? i.e. How should the SQL read?
I'm Guessing
1) save Code as : "Select * from table where PostDate >= |STARTDATE| and
PostDate < |ENDDATE|"
2) Set mySQL = SQLfield where record is selected on form.
3) Replace |STARTDATE| with form's Start Date and |ENDDATE| with form's End
Date using a find/replace function? (I need help here.)
4) docmd.Execute mySQL
Since I'm new. I wanted to run this theory past you kind folks.
Thanks
meterman