Solved

Data Report Between Two Dates

Posted on 2000-05-02
6
259 Views
Last Modified: 2008-02-20
I have created a datareport based on the dataenvironment for a table that keeps tract of contacts. I want to be able to print the report between two dates that the user selects, for instance, 021000 and 031500. My preference would be to input the dates from the dropdown calendar control that ships with VB but it seems to always want to give me the time as well as the date as a result of my selection. If this can't be used I guess I could use a pair of input boxes.

Once this is solved, how would I pass these dates to the datareport?

Any help would be most appreciated.

Rev. Michael L. Burns
0
Comment
Question by:wwvagnu
6 Comments
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
As far as using the dates, you can format the Now variable which gives the date and time. For example:

Dim date As String
date = Format(Now,"MMDDYY")

that should return the value you are looking for, obviously you can play with the format to make however you wish.
0
 
LVL 15

Expert Comment

by:StingRaY
Comment Utility
Date in format YYYYMMDD is better.
Store it as String data type.
It is easy to manipulate.
But if you store in format "MMDDYY"
You can convert it to YYMMDD using Left, Mid, Right Function. Use them in your SQL Statement is okay (For Access Database)

0
 
LVL 2

Expert Comment

by:Tchalkov
Comment Utility
You'll need to open dynamicly dataenvironment recordsets:



        DataEnvironment.rsCommand1.Source = "select from Table1 where Date1>=#" & strFirstDate & "# and Date1<=#" & strLastDate & "#"
DataEnvironment.rsCommand1.Open
DataReport1.Show


0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Accepted Solution

by:
cys050200 earned 50 total points
Comment Utility
i feel that the solution would be:
date = Format(Now,"MMDDYY")

0
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
cys,
please retract your answer to a comment
0
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now