Need help with FORMAT syntax

G

Guest

I have a calculated field on a report in access 2000. Currently, it goes to
the attendance table and adds up all the hours for a particular student. It
works fine but what I need to do now is add up all the hours WITHIN A RANGE
OF DATES for the student. The query that runs the report already prompts the
user for the date range. How would I reformat this syntax to just select the
records within the range of dates the user types in?

=Format(Nz(DSum("dailyHours","attendance_clock_in","studentid=" &
[employeeid]),0),"Fixed")

Thanks.
 
D

Duane Hookom

If you want to sum values from in a report, don't use DSum(). You should be
able to use just Sum(). Assuming you have a StudentID footer and a numeric
field [DailyHours], you should be able to use a text box with a control
source of:
=Sum([DailyHours])
 
G

Guest

Thanks for your quick reply. The attendance table is not part of the query
for the report. I am trying to pull that information into the report without
writing additional queries. The total hours is just one field among many on
the report and the query for the report is already too complex and contains
numerous tables so instead of changing it I just want to go out to that table
and calculate that total.
 
D

Duane Hookom

Followup in more recent thread.

--
Duane Hookom
MS Access MVP
--

Stonewall said:
Thanks for your quick reply. The attendance table is not part of the
query
for the report. I am trying to pull that information into the report
without
writing additional queries. The total hours is just one field among many
on
the report and the query for the report is already too complex and
contains
numerous tables so instead of changing it I just want to go out to that
table
and calculate that total.

Stonewall said:
I have a calculated field on a report in access 2000. Currently, it goes
to
the attendance table and adds up all the hours for a particular student.
It
works fine but what I need to do now is add up all the hours WITHIN A
RANGE
OF DATES for the student. The query that runs the report already prompts
the
user for the date range. How would I reformat this syntax to just select
the
records within the range of dates the user types in?

=Format(Nz(DSum("dailyHours","attendance_clock_in","studentid=" &
[employeeid]),0),"Fixed")

Thanks.
 

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

Similar Threads


Top