Okechi has attended:
Excel VBA Intro Intermediate course
Excel VBA Advanced course
Data Reporting
What codes does one need to be able to use the input box to extract data to be reported for a specified period?
RE: Data Reporting
Hi Okechi
Thank you for your question
You would first need to create two date variables, one for the start date and another for the end date.
You would then embed the two variables into an SQL statement that is used to define the ADO recordset object.
The key is to use a where clause in the sql and embed the two variables, literally quoting the # symbol as in the example below
Const SQL As String = "SELECT * FROM qryOrdersForExcel WHERE OrderDate >=" & "#" & dteStart & "#" & "AND OrderDate <=" & "#" & dteFinish & "#"
Hope this is useful
Regards
Stephen