You have to tell us how you want your table to fit into the result. Your
question was to count the number of days between two dates. Then you added
that you wanted these grouped by month. That is what you have.
Now you have mentioned a table and two fields. You need to provide several
sample records and how your friend would like to see a result displayed.

Signature
Duane Hookom
MS Access MVP
--
>I appreciate your patience with me.
>
[quoted text clipped - 62 lines]
>> >> >> >
>> >> >> > Any ideas?
I apologize.
I have a table with a start date and an end date. These dates are for entry
and exit of a program. I need to be able to count the days each month that a
person in in the program. meaning if 3 people are in the program in January,
one for 4 days, one for 7 days and one for 8 days, I need to create a report
that will calculate and give me the total of 15 days. Since the program can
span over a month, meaning start in January and end in Feb or March, I need
to be able to count the number of days then person is in the program for each
month.
I thought a cross tab report might be the easiest way to break it down, but
I'm open if there is a better way.
I apologize for not being clearer with my initial question.
> You have to tell us how you want your table to fit into the result. Your
> question was to count the number of days between two dates. Then you added
[quoted text clipped - 69 lines]
> >> >> >> >
> >> >> >> > Any ideas?
Duane Hookom - 06 Dec 2005 15:32 GMT
Create a query with your table with no name given and the table of dates
that I suggested earlier.
Don't join the tables and change the query to a totals query.
Add the field "theDate" to the grid and change the column to
Mth:Month([theDate]).
Add "theDate" field to the query again
change the Total from Group By to Where
Set the criteria to
Between [Start Date] and [End Date]
Add the primary key field from your table with no name
change the Total from Group By to Count
Your final SQL view should look something like:
SELECT Month([TheDate]) AS Mth,
Count([ID]) AS NumOfDays
FROM tblDates, tblWithNoNameGiven
WHERE TheDate Between [Start Date] And [End Date]
GROUP BY Month([TheDate]);

Signature
Duane Hookom
MS Access MVP
--
>I apologize.
>
[quoted text clipped - 101 lines]
>> >> >> >> >
>> >> >> >> > Any ideas?