data reporting
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Data Reporting

Data Reporting

resolvedResolved · Low Priority · Version 2003

replyReply Fri 20 Feb 2009, 14:52Delegate Okechi said...

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

replyReply Thu 5 Mar 2009, 14:45Trainer Stephen said...

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.

 

Please browse our web site to find out more about
vba for excel training and other Microsoft training courses.

Excel tip:

Freeze Rows and Columns to keep lables displayed

You can freeze rows and columns in your worksheet so they don't move.

This allows you to keep row and column labels displayed on your screen as you move through a large worksheet.

Click below and/or to the right of the cell(s) you want to freeze. (NB. Excel freezes ALL the rows above and ALL the columns to left of the selected cell)

Click on the 'Windows' menu and selct 'Freeze Panes'.

Lines appear in your worksheet. The required rows and columns are frozen and remain on your screen as you move through your worksheet.

To unfreeze rows and columns, click on 'Window' menu and select 'Unfreeze Panes'.

View all Excel hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard