Solved

Data Report Between Two Dates

Posted on 2000-05-02
6
265 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
Technology Partners: 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!

 

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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

734 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