Display Dates

wop0703

Registered User.
Local time
Today, 13:53
Joined
Jun 1, 2005
Messages
77
I would like to eventually creat a chart report with information I have in a query. My problem is that I cannt get the correct information in my query. I want a user to input three begin and end dates and I want the appropriate information displayed in my query. Please help me figure out how to get this information.
 
Assuming you want Access to prompt the user for three pairs of dates enter this in the criteria lines in your dates column in the query grid:
Between [Input Start Date 1] And [Input End Date 1]
Between [Input Start Date 2] And [Input End Date 2]
Between [Input Start Date 3] And [Input End Date 3]

It would be neater to do this with a form and use text boxes to capture the relevant dates, but the above will work. The SQL of the query will look a bit like this:
Code:
SELECT tblDates.DatesID, tblDates.Data1, tblDates.Data2, tblDates.MyDate
FROM tblDates
WHERE (((tblDates.MyDate) Between [Input Start Date 1] And [Input end date 1])) OR (((tblDates.MyDate) Between [Input Start Date 2] And [Input end date 2])) OR (((tblDates.MyDate) Between [Input Start Date 3] And [Input end date 3]));
 
Still Struggling

For some reason, the query is only taking the last two dates I give it. It seems as though it is ignoring all of the ones before the last one.
 
One down, one to go

OK, I have my dates working now, but it is giving me alot of duplicate information. Any suggestions?
 
Possibly your Input date ranges overlap.
If not, most lileky your query returns a cartesian product.
If so, that's due to missing and / or incorrect joins in your query.
Bit hard to tell....

Run a test by entering non-overlapping Input date ranges.
If your query returns multiple records, post your query.

RV
 
Still Struggling

Here is the thing, my created query is hierarchial and posting the single query probably will not help you much. Does each column of a query have to be filled in, in order for the query to show up?
 

Users who are viewing this thread

Back
Top Bottom