Adding two items on report to get a sum of both

P

peterde

Hi. I am in the process of modifying a established report to make it more
meaningful. In the report there are two quires that give an answer. I want to
add a third box adding these two together.

The first one is: =IIf([TotalCash] Is Null Or 0,"0:00",(Int([TotalCash]/60))
& ":" & (Format((([TotalCash])-((Int([TotalCash]/60))*60)),"00")))

The sencond one: =IIf([Time] Is Null Or 0,"0:00",(Int([Time]/60)) & ":" &
(Format((([Time])-((Int([Time]/60))*60)),"00")))

I would like to add those 2 results together, TIME and TOTALCASH to give a
third total (sum) to be named TOTALOT (in hh:mm). I am having trouble in
creating the query. Is this even possible? Thanks for any help that's offered.
 
A

Allen Browne

Both expressions you created are text (not numeric) so you cannot sum them.

Change the Control Source to:
=IIf([TotalCash] Is Null, 0, Int([TotalCash]/60])
Then use the Format property of the text box to make it display the way you
want.

Likewise with the second.

You will then be able to sum them with a 3rd box that has Control Source of:
=[T1] + [T2]
substituting the name of your other text boxes, and putting this 3rd box
into the same section as the other two.
 

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