Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Data Reporting
Data Reporting
Resolved · Low Priority · Version 2003
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?
For upcoming training course dates see: Pricing & availability
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
Thu 12 Mar 2009: Automatically marked as resolved.
|
