By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,140 Members | 1,301 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,140 IT Pros & Developers. It's quick & easy.

Determine dates occupied

P: n/a
I have a campsite database that tracks the campsite, date arrived and
number of days stayed.

I need to have statistics showing how many campers were at the
campground on any given day or date range. For example, the month of
July I have 2 campers on July 1, 7 on July 2, 28 on July 3, 29 on July
4, etc.

Should I be collecting the data differently that the date arrived and
number of days stayed?

If a camper arrives July 2 and stays for 10 days, how can I show that
the campsite was occupied on July 2, 3, 4, 5, 6, 7, 8, 9, 10 and 11?

Thanks,
Confused/In need of help!
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hello Annette,

Do see how many people were at your campsite on a given date, the query
criteria is

Between [ArrivalDate] and ([ArrivalDate] + [DaysStayed] - 1)

The -1 is because, I assume, that if a person arrives July 1 and stays one
day, you do not want to count them for July 2.

Access date arithmetic has the nice feature that one is the same as the
integer 1, so you can add a number of days to a date field easily.

Hope this helps.

Gary

"Annette Massie" <an******@co.saint-croix.wi.us> wrote in message
news:c6**************************@posting.google.c om...
I have a campsite database that tracks the campsite, date arrived and
number of days stayed.

I need to have statistics showing how many campers were at the
campground on any given day or date range. For example, the month of
July I have 2 campers on July 1, 7 on July 2, 28 on July 3, 29 on July
4, etc.

Should I be collecting the data differently that the date arrived and
number of days stayed?

If a camper arrives July 2 and stays for 10 days, how can I show that
the campsite was occupied on July 2, 3, 4, 5, 6, 7, 8, 9, 10 and 11?

Thanks,
Confused/In need of help!

Nov 12 '05 #2

P: n/a
TC
Personally, I would store DateArrived and DateDeparted. This is because it
is easier to get a date correct, than to get the # of days stayed correct.
We all know today is 28 Sep 2003 (or whatever), but have we been here 13
days, or was it 14?

Either way, you then write queries to give you whatever you want, from that
data. For example, storing DateArrived and DateDeparted, this would find the
number of campers at site #123 on 1/1/2003:

SELECT COUNT(*) FROM tblCampers
WHERE CampsiteID = 123
AND #1/1/2003# BETWEEN DateArrived AND DateDeparted

HTH,
TC
Annette Massie <an******@co.saint-croix.wi.us> wrote in message
news:c6**************************@posting.google.c om...
I have a campsite database that tracks the campsite, date arrived and
number of days stayed.

I need to have statistics showing how many campers were at the
campground on any given day or date range. For example, the month of
July I have 2 campers on July 1, 7 on July 2, 28 on July 3, 29 on July
4, etc.

Should I be collecting the data differently that the date arrived and
number of days stayed?

If a camper arrives July 2 and stays for 10 days, how can I show that
the campsite was occupied on July 2, 3, 4, 5, 6, 7, 8, 9, 10 and 11?

Thanks,
Confused/In need of help!

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.