Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / December 2007

Tip: Looking for answers? Try searching our database.

Counting function

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Zb Kornecki - 22 Dec 2007 01:36 GMT
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
Marshall Barton - 22 Dec 2007 01:46 GMT
>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
[quoted text clipped - 6 lines]
>time b = enter que
>time c = exit que

Could it be this simple?

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

Signature

Marsh
MVP [MS Access]

Zb Kornecki - 22 Dec 2007 03:16 GMT
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

> >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
[quoted text clipped - 10 lines]
>
> DCount("*", "thetable", "timeA Between timeB And timeC")
Marshall Barton - 22 Dec 2007 05:03 GMT
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?
Signature

Marsh
MVP [MS Access]

>Marsh thanks for the quick response I wrote this in a query but it returned 0
>for every record.
[quoted text clipped - 16 lines]
>>
>> DCount("*", "thetable", "timeA Between timeB And timeC")
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.