If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Adding two items on report to get a sum of both
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. |
#2
|
|||
|
|||
Adding two items on report to get a sum of both
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. -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "peterde" u57519@uwe wrote in message news:a22d823f37207@uwe... 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. |
Thread Tools | |
Display Modes | |
|
|