A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Adding two items on report to get a sum of both



 
 
Thread Tools Display Modes
  #1  
Old January 16th, 2010, 03:42 AM posted to microsoft.public.access.reports
peterde
external usenet poster
 
Posts: 1
Default 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  
Old January 16th, 2010, 05:30 AM posted to microsoft.public.access.reports
Allen Browne
external usenet poster
 
Posts: 11,706
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:00 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.