DCounting and Dates

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table that keeps track of guests arriving at a resort. The table
name is "bookings" and the field name is "arrival".

I am trying to add several statistics to the main navigation formto show how
many bookings are scheduled to arrive within the next 3 days.

X = DCount("[arrival]", "bookings", ????)

I'm not quite sure what to put in for the expression though - I can't quite
get anything to work. Do you know what would I use for the condition if I
wanted to count bookings that only are arriving on today, tomorrow, or the
day after?

Thanks!

Nick
 
Hi, Nick.
I am trying to add several statistics to the main navigation formto show how
many bookings are scheduled to arrive within the next 3 days. .. . .
Do you know what would I use for the condition if I
wanted to count bookings that only are arriving on today, tomorrow, or the
day after?

Today, tomorrow and the day after are not "within the next three days," but
if your last assertion is actually what you want, then try:

X = DCount("arrival", "bookings", "(arrival BETWEEN Date( ) AND Date( ) + 2)")

Or, if you'd prefer "within the next three days," then try:

X = DCount("arrival", "bookings", "(arrival BETWEEN Date( ) AND Date( ) + 3)")

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.


Tatakau said:
I have a table that keeps track of guests arriving at a resort. The table
name is "bookings" and the field name is "arrival".

I am trying to add several statistics to the main navigation formto show how
many bookings are scheduled to arrive within the next 3 days.

X = DCount("[arrival]", "bookings", ????)

I'm not quite sure what to put in for the expression though - I can't quite
get anything to work. Do you know what would I use for the condition if I
wanted to count bookings that only are arriving on today, tomorrow, or the
day after?

Thanks!

Nick
 
Gunny - you are my hero! I can't thank you enough for helping me out so much
over the past... well, I've been working on this project for the past month
and a half, so you have probably been helping me out with all of my random
questions for about as long. I really appreciate it!

I would really like to thank you for the time you've spent helping me.
Please shoot me an e-mail some time!

(e-mail address removed)

Thanks again!

Nick

'69 Camaro said:
Hi, Nick.
I am trying to add several statistics to the main navigation formto show how
many bookings are scheduled to arrive within the next 3 days. . . .
Do you know what would I use for the condition if I
wanted to count bookings that only are arriving on today, tomorrow, or the
day after?

Today, tomorrow and the day after are not "within the next three days," but
if your last assertion is actually what you want, then try:

X = DCount("arrival", "bookings", "(arrival BETWEEN Date( ) AND Date( ) + 2)")

Or, if you'd prefer "within the next three days," then try:

X = DCount("arrival", "bookings", "(arrival BETWEEN Date( ) AND Date( ) + 3)")

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.


Tatakau said:
I have a table that keeps track of guests arriving at a resort. The table
name is "bookings" and the field name is "arrival".

I am trying to add several statistics to the main navigation formto show how
many bookings are scheduled to arrive within the next 3 days.

X = DCount("[arrival]", "bookings", ????)

I'm not quite sure what to put in for the expression though - I can't quite
get anything to work. Do you know what would I use for the condition if I
wanted to count bookings that only are arriving on today, tomorrow, or the
day after?

Thanks!

Nick
 
Back
Top