Counting function

Z

Zb Kornecki

I would appreciate some help writing a function for access. I have a table
that contains 3 date fields. I need a function that returns a count
(integer) of how many times Time A falls between Time B and Time C. every
record has all 3 times.

The goal is is to determin how many people are already waiting in the que as
as a new customer arrives.
time a = arrival
time b = enter que
time c = exit que

Thank-you
Zb
 
M

Marshall Barton

Zb said:
I would appreciate some help writing a function for access. I have a table
that contains 3 date fields. I need a function that returns a count
(integer) of how many times Time A falls between Time B and Time C. every
record has all 3 times.

The goal is is to determin how many people are already waiting in the que as
as a new customer arrives.
time a = arrival
time b = enter que
time c = exit que


Could it be this simple?

DCount("*", "thetable", "timeA Between timeB And timeC")
 
Z

Zb Kornecki

Marsh thanks for the quick response I wrote this in a query but it returned 0
for every record.

Waiting: DCount("*",[TC_Time_Stamps]," [TC_Time_Stamps]![Arrival] between
[TC_Time_Stamps]![Start Que] and [TC_Time_Stamps]![End Que]")

Any suggestions
Zb
 
M

Marshall Barton

Query? What query? I thought you wanted to use this in a
text box expression or a VBA procedure.

In those cases, I think you need to use:

DCount("*", "TC_Time_Stamps", "Arrival Between [Start Que]
And [End Que]")

Using that in a query doesn't make much sense because the
function's value will be the same on every row.

Or did I misunderstand what you want to do?
--
Marsh
MVP [MS Access]


Zb said:
Marsh thanks for the quick response I wrote this in a query but it returned 0
for every record.

Waiting: DCount("*",[TC_Time_Stamps]," [TC_Time_Stamps]![Arrival] between
[TC_Time_Stamps]![Start Que] and [TC_Time_Stamps]![End Que]")


Marshall Barton said:
Could it be this simple?

DCount("*", "thetable", "timeA Between timeB And timeC")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top