The record source for the report is SELECT [tblIssueData].[RegNumber],
[tblIssueData].[ModCenterRef], [tblIssueData].[Status],
[tblIssueData].[CauseType], [tblIssueData].[ID],
[tblIssueData].[Originator],
[tblIssueData].[DesignChange], Sum([tblTimeBilled].[Hours]) AS SumOfHours,
[tblIssueData].[Cause of Issue] AS CauseDesc,
[tblIssueData].[ResPrimaryDoc]
FROM tblCauseData INNER JOIN ((tblIssueData INNER JOIN tblTasks ON
[tblIssueData].[TaskID]=[tblTasks].[TaskID]) INNER JOIN tblTimeBilled ON
[tblTasks].[TaskID]=[tblTimeBilled].[TaskID]) ON
[tblCauseData].[CauseID]=[tblIssueData].[CauseType] GROUP BY
[tblIssueData].[RegNumber], [tblIssueData].[ModCenterRef],
[tblIssueData].[Status], [tblIssueData].[CauseType], [tblIssueData].[ID],
[tblIssueData].[Originator], [tblIssueData].[DesignChange],
[tblIssueData].[Cause of Issue], [tblIssueData].[ResPrimaryDoc]; I want to
get a value in the report, not a sum.
Duane Hookom said:
What is the field in your report's record source that you want on your
report and where on your report? Is the value to display a Sum() or
straight
value?
--
Duane Hookom
MS Access MVP
For the report, I'm selecting data from five tables, including two
linked
tables. I'm then summing the hours from one of the linked tables,
grouped
by
an id#, in the query to get the sum of hours for each task. On the
report,
the hours are listed by id# and 5 other fields. There can be multiple
hours
for an id#, which is why I'm summing the hours.
:
First, you should not create an IIf() expression that might return
either
a
string ("0") or a numeric value ([SumOfHours]). I expect you would
want
to
use:
=IIf(IsNull([SumOfHours]),0, [SumOfHours])
I am not confident this will fix your issue. If your report doesn't
return
any records, you will need to use something like:
=IIf(HasData,[SumOfHours],0)
It isn't clear if there are any subreports involved in this issue.
--
Duane Hookom
MS Access MVP
--
Why does the expression =IIf(IsNull([SumOfHours]),"0", [SumOfHours])
giving
me the answer of #Error on my report? I have two databases linked,
and
the
values are be pulled from the second database. If the assignment
hasn't
been
worked on, no hours are entered in the second databases tables. On
my
report
in the first database, if there are no hours for that project, I
want
"0"
printed in the appropriate place on the report, otherwise print the
sum
of
the hours worked. Can I get some help. What am I missing?