View Full Version : Run sum works for one not the Other?


rainman89
03-12-2007, 09:32 AM
Hi all,
I have two text boxes that are getting their info from a query that i have filtered for each box.
txtInvestigativeTime =IIf([TaskID]<>2,[TotalTime],"")
txtAdministrativeTime =IIf([TaskID]=2,[TotalTime],"")

problem is i want a runsum for each to display on footer of report.
So i have the runsumboxes

RunSumInvest "Sum overall"
RunSumAdmin "Sum overall"

works fine for Invest box but wont sum for the other.

copy & pasted exact boxes and just changed the info inside... still nothing.

any suggestions?

Check that... it doesnt work for it. numbers are off... weird.
It resets when it is at zero or a blank cell... nz function doesnt work for it. any suggestions?

shudini
03-12-2007, 10:07 AM
Are you looking for a running sum, or are you looking for a total at the end of the report? In either case, how are you setting the properties of the txt boxes?

rainman89
03-12-2007, 10:09 AM
total is what i really want.
the txt box properties are set as above. they are just unbound txt boxes.

shudini
03-12-2007, 10:14 AM
Why not use
DSum("TaskID","TotalTime","TaskID<>2")
for txtInvestigativeTime and
DSum("TaskID","TotalTime","TaskID=2")
for txtAdministrativeTime

Of course this will only work assuming there are no other filters being applied to the report. If there are, your other option is to just place a text box in the report footer and enter =Sum([NameOfTextBoxFromDetailSection]).

pbaldy
03-12-2007, 10:14 AM
Are there any null values in the data?

rainman89
03-12-2007, 10:17 AM
Tried the sum box didnt work right

I set the default of the txt box to
txtInvestigativeTime =IIf([TaskID]<>2,[TotalTime],"") <--Null cuz zeros are ugly

rainman89
03-12-2007, 10:21 AM
No ididnt set it to null either!! "" is not null
DOH!!! figured it out guys thanks!

having the default as "" is what mesed up the whole thing. messed around with it for way too long to have such a simple solution... embarassing

pbaldy
03-12-2007, 01:07 PM
txtInvestigativeTime =IIf([TaskID]<>2,[TotalTime],"") <--Null cuz zeros are ugly

No ididnt set it to null either!! "" is not null

Thanks, that was funny.

rainman89
03-12-2007, 01:08 PM
Haha well glad my incompetance can be found amusing by others!! :P