I have a query with that has a variable (it’s a date – more on this later)
The table that I am getting the info from is called Employee, it is flat it just has “Employee Name”, “StartDate.” It has about 50 records in the table. I’m doing this to learn Access’ logic before I tackle bigger projects. OK on a form I want to have the user enter in a date and it output the workers who started before that date.
So I wrote up a query in access' design view that works fine if I input the date (it gives you an inputbox when I run the query from access.)
I want to create a form that has a text box where the user enters the date and it processes the query with that date (instead coming from the input box) – and a button to run the query.
I’d like access to either output it as a query (normally in access) or output it to excel if possible.
By the way I'm not worried with verification (that it's a date - there's an IsDate function built into access' vba that I'll use).
Also I have the SQL from the query saved - it's just
SQL_Query= "Select * from Employee where ((Round((((CDate(" & X & "))-[StartDate])/365),3))>0)"
Where X would be the date. Is there any way to easily do this?
Does my question make sense?
Thanks!
Mat
The table that I am getting the info from is called Employee, it is flat it just has “Employee Name”, “StartDate.” It has about 50 records in the table. I’m doing this to learn Access’ logic before I tackle bigger projects. OK on a form I want to have the user enter in a date and it output the workers who started before that date.
So I wrote up a query in access' design view that works fine if I input the date (it gives you an inputbox when I run the query from access.)
I want to create a form that has a text box where the user enters the date and it processes the query with that date (instead coming from the input box) – and a button to run the query.
I’d like access to either output it as a query (normally in access) or output it to excel if possible.
By the way I'm not worried with verification (that it's a date - there's an IsDate function built into access' vba that I'll use).
Also I have the SQL from the query saved - it's just
SQL_Query= "Select * from Employee where ((Round((((CDate(" & X & "))-[StartDate])/365),3))>0)"
Where X would be the date. Is there any way to easily do this?
Does my question make sense?
Thanks!
Mat