Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

data reporting

ResolvedVersion 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?

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.

 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Excel tip:

Jumping Across the Excel Screen

PgDn and PgUp keys scrolls up and down a screen page in most applications.

Alt+PgDn and Alt+PgUp is the equivalent across the spreadsheet.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.