kbsudhir
02-24-2008, 11:41 AM
I am connecting my excel file to Access 2003 Database which has query.
I have a "where" condition in that query with "Between" Clause.
I want to pull the data between two dates ex. Between 1st Jan 2008 & 31st Jan 2008.
This is the query which I am writing in my excel VBA to initiate the query in the database.
rs.Open "select * from IndividualData where Date Between'" & StartDate & "' AND '" & EndDate & "'", cn, adOpenStatic, adLockReadOnly
To allow the user to provide the start data I am using an input box.
StartDate for getting the initial date
and
EndDate to get the End Date.
I am getting an error in the above line of code, I want to know whats the correct syntax for the above code.
Any help regarding the same is appreciated.
Thanks
Sudhir
I have a "where" condition in that query with "Between" Clause.
I want to pull the data between two dates ex. Between 1st Jan 2008 & 31st Jan 2008.
This is the query which I am writing in my excel VBA to initiate the query in the database.
rs.Open "select * from IndividualData where Date Between'" & StartDate & "' AND '" & EndDate & "'", cn, adOpenStatic, adLockReadOnly
To allow the user to provide the start data I am using an input box.
StartDate for getting the initial date
and
EndDate to get the End Date.
I am getting an error in the above line of code, I want to know whats the correct syntax for the above code.
Any help regarding the same is appreciated.
Thanks
Sudhir