Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Microsoft Access > Re: Daily count...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 6 of 9 Topic 30235 of 31306
Post > Topic >>

Re: Daily counts

by "Fred Zuckerman" <ZuckermanF@[EMAIL PROTECTED] > May 12, 2008 at 09:50 PM

"Ed Robichaud" <edrobichaud@[EMAIL PROTECTED]
> wrote in message 
news:48291462$0$11189$2ff6ac69@[EMAIL PROTECTED]
> Thanks, but I'm not explaining this well enough.
>
> I have attendance-type records that have only an individual's start and 
> stop dates - such as:
>           ID       Start    Stop
>         001; 3/2/08; 3/20/08;...
>          002; 3/1/08; 3/18/08;...
>          003; 03/15/08;3/20/08;...
>
> I'd like to be able to show how many ID's were present on any date in
that 
> range; ie. from the above, there would be 1 on 3/1/08, 2 on 3/2/08, 3 on

> 3/15/08, 2 on 3/20/08, 0 on 3/21/08, etc.
>
> Is this even possible?  I'm stuck with these legacy records as they are.

> Th****s in advance.
> -Ed
>
>
> "Salad" <oil@[EMAIL PROTECTED]
> wrote in message 
> news:5qGdncYHU9-4FbXVnZ2dnUVZ_vjinZ2d@[EMAIL PROTECTED]
>> Ed Robichaud wrote:
>>> I'm struggling to come up with a query/re****t of daily attendance for 
>>> records that have only start and stop dates.  A x-tab (with parameters

>>> that records be within a selected date range)   would seem to be the
way 
>>> to go here, but how do I get a count for each date within that range?
>>>
>>> thanks -Ed
>> I'm not sure why you need an x-tab.
>>
>> You need to determine which date you want to filter on.  The start
date? 
>> The stop date?
>>
>> Here's an example of using the start date.
>>
>> SELECT StartDate, Count(StartDate) AS CountOfStartDate
>> FROM YourTableName
>> GROUP BY StartDate
>> HAVING StartDate Between [Enter Start Date] And [Enter End Date]))
>> ORDER BY StartDate;
>>
>> How to create this query
>> Open up the new query (Query/New/Design) and select your table to
query. 
>> Drag the start date to two columns.  Select View/Totals from the menu.
On 
>> the Totals row the first column should be GroupBy, the second Count. 
In 
>> the criteria row for the first date column enter
>> Between [Enter Start Date] And [Enter End Date]
>> Run the query and see if it does what you want.
>>
>> The Model
>> http://www.youtube.com/watch?v=QgS252XT_Ts
>

How about a function as below.
Fred Zuckerman

'(caution aircode)
Public Function Attendance (fDate as Date) As Integer
   Dim rst as DAO.Recordset
   set rst = CurrentDb.OpenRecordset("tblLegacy")
   rst.MoveFirst
   Attendance = 0
   Do Until rst.EOF
      If fDate Between rst!StartDate And rst!EndDate Then
         Attendance = Attendance + 1
      Endif
      rst.MoveNext
   Loop
   rst.Close
   set rst = Nothing
End Function
 




 9 Posts in Topic:
Daily counts
"Ed Robichaud"   2008-05-12 12:24:44 
Re: Daily counts
Pachydermitis <praesag  2008-05-12 10:00:02 
Re: Daily counts
"Ed Robichaud"   2008-05-12 13:26:07 
Re: Daily counts
Salad <oil@[EMAIL PROT  2008-05-12 11:10:43 
Re: Daily counts
"Ed Robichaud"   2008-05-13 00:09:02 
Re: Daily counts
"Fred Zuckerman"  2008-05-12 21:50:55 
Re: Daily counts
Salad <oil@[EMAIL PROT  2008-05-12 21:54:54 
Re: Daily counts
"Ed Robichaud"   2008-05-19 10:37:37 
Re: Daily counts
"rquintal@[EMAIL PRO  2008-05-14 09:49:36 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Oct 13 16:21:10 CDT 2008.