Dates

R

Randy

Hello all....I have developed an attendance tracking report in my database
and I have a field on a report that I need to count the number of days in a
quarter (jan-mar, etc) a particular student attended class. Anyone have any
ideas? This is what I have so far:
=Count([AttendanceDate]) & " " & "Days"

I can't seem to figure out the "range" part...
Any help/suggestions would be most appreaciated.
 
S

Steve Schapel

Randy,

This is a Report or Query question, rather than being Macro-related.

In design view of your report, go to the Sorting & Grouping dialog, and
in the Field/Expression column, type the equivalent of...
=DatePart("q",[AttendanceDate])
.... and then in the Group Properties section at the bottom, set the
Group Footer to Yes.
Put your unbound count textbox in this footer section of the report,
with Control Source like this...
=Count(*) & " Days"

Let us know if this does the trick, or if I have misunderstood the question.
 
R

Randy

Hey Steve....This worked great! However, I have separate fields. I need one
field to count the number of days from Jan-Mar, the next field needs to count
the days from Apr-Jun etc....Is there a way I could but en expression within
the
Count(*) & " Days" expression/control source?

Steve Schapel said:
Randy,

This is a Report or Query question, rather than being Macro-related.

In design view of your report, go to the Sorting & Grouping dialog, and
in the Field/Expression column, type the equivalent of...
=DatePart("q",[AttendanceDate])
.... and then in the Group Properties section at the bottom, set the
Group Footer to Yes.
Put your unbound count textbox in this footer section of the report,
with Control Source like this...
=Count(*) & " Days"

Let us know if this does the trick, or if I have misunderstood the question.

--
Steve Schapel, Microsoft Access MVP

Hello all....I have developed an attendance tracking report in my database
and I have a field on a report that I need to count the number of days in a
quarter (jan-mar, etc) a particular student attended class. Anyone have any
ideas? This is what I have so far:
=Count([AttendanceDate]) & " " & "Days"

I can't seem to figure out the "range" part...
Any help/suggestions would be most appreaciated.
 
S

Steve Schapel

Randy,

Do you mean you've got want 4 unbound textboxes, one for the figure for
each quarter? Then I guess we are talking about this going in the
Report Footer section rather than a Group Footer. Right? Ok, try it
like this... put this in the Control Source of the textboxes...
=Abs(Sum(DatePart("q",[AttendanceDate])=1))
.... and the same for 2, 3, and 4.
 
R

Randy

You my friend are AWESOME!!! It worked!!!! Thank you Thank you Thank you
Thank you Thank you Thank you Thank you Thank you Thank you Thank you!

Steve Schapel said:
Randy,

Do you mean you've got want 4 unbound textboxes, one for the figure for
each quarter? Then I guess we are talking about this going in the
Report Footer section rather than a Group Footer. Right? Ok, try it
like this... put this in the Control Source of the textboxes...
=Abs(Sum(DatePart("q",[AttendanceDate])=1))
.... and the same for 2, 3, and 4.

--
Steve Schapel, Microsoft Access MVP
Hey Steve....This worked great! However, I have separate fields. I need one
field to count the number of days from Jan-Mar, the next field needs to count
the days from Apr-Jun etc....Is there a way I could but en expression within
the
Count(*) & " Days" expression/control source?
 

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