Solved

Data Report Between Two Dates

Posted on 2000-05-02
6
266 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 28

Expert Comment

by:AzraSound
ID: 2772152
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
ID: 2772160
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
ID: 2772365
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
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 

Accepted Solution

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

0
 
LVL 28

Expert Comment

by:AzraSound
ID: 2773961
cys,
please retract your answer to a comment
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 2774893
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month6 days, 14 hours left to enroll

623 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