Date Ranges

nancybrown

Well-known Member
Joined
Apr 7, 2005
Messages
868
I have a visitor table with start date and end date fields. A "DAILY" report is generated by entering the new date in a parameter box, e.g., tomorrow's report would have 12/2/05 entered into the parameter box. All visitors for that day appear on the report.

Currently if we have a visitor that is here for 10 days, we have to manually enter each 10 days worth of dates in order for the dates to appear on the e DAILY report. Is there an easier way? I tried using an ActivX Calendar, but it doesn't add a new record to the table with each subsequent date, it only increases the start date by one.

Thanks in advance.
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
HI,

Have StartDate and EndDate Fields,

Query would be:

SELECT YourInfo FROM YourTable WHERE StartDate <= DateYouAskFor AND EndDate >= DateYouAskFor;

With this type of problem it's always best to have both the Start and End dates in your table.

If a vistor had a start date but no end date you can use:

SELECT YourInfo FROM YourTable WHERE StartDate <= DateYouAskFor AND (EndDate >= DateYouAskFor OR EndDate IS NULL);
 
Upvote 0
Hi Ian,

I do have fields for start date and end dates in my table. I have a data entry form that is linked to this table. In that form I need to enter these start and end dates, how do I connect the query you suggested to the start date and end date fields on the form. Sorry . . . new to Access.
 
Upvote 0
OO, now you've asked :)

I'll put something proper together later, I'm just going to work but want to let you know I will answer you.

There are a lot of ways to do this.

Firstly, are you going to be displaying the results on the same Form or are you simple using the Form for the Criteria and displaying the results elsewhere.

Another thing you might try is looking at the 'Solutions' Database which gets bundled with MS Office.
Search your C: Drive for Solutions.mdb.
This has a wealth of tables, queries, forms you can dissect, open it holding shiftdown for the juicy stuff.

Regards,
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,715
Members
448,985
Latest member
chocbudda

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top