Need help with FORMAT syntax

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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])
 
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.
 
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.
 
Back
Top