Sum Function Help Please

I have created two Option Groups, setting up values against the radio buttons.
The output from both boxes works fine (thanks to the Wizard), however when 
I'm creating a formula on the report, I'm unable to add the two returned 
values together.

If I type in =([Q1]+[Q2])    then I get both numbers concatenated together 
(ie returned value from Q1 is 1 and returned value from Q2 is 2, the answer 
I get is 12 !!!!.) 

Interestingly if I enter =([Q1]-[Q2]) then I get the correct answer.

Any help would be greatly appreciated here.
0
Utf
1/23/2010 3:44:01 PM
access.forms 6864 articles. 2 followers. Follow

2 Replies
1209 Views

Similar Articles

[PageSpeed] 40

I could be wrong, but it seems like access isn't understanding that the 
fields are numeric values.  Perhaps you could try something like:

=CDbl([Q1])+CDbl([Q2])
or
=CInt([Q1])+CInt([Q2])
....

Use the appropriate conversion based on your data.
-- 
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.



"Al Morton" wrote:

> I have created two Option Groups, setting up values against the radio buttons.
> The output from both boxes works fine (thanks to the Wizard), however when 
> I'm creating a formula on the report, I'm unable to add the two returned 
> values together.
> 
> If I type in =([Q1]+[Q2])    then I get both numbers concatenated together 
> (ie returned value from Q1 is 1 and returned value from Q2 is 2, the answer 
> I get is 12 !!!!.) 
> 
> Interestingly if I enter =([Q1]-[Q2]) then I get the correct answer.
> 
> Any help would be greatly appreciated here.
0
Utf
1/23/2010 3:56:03 PM
Daniel - first formula worked a treat. My kind thanks to you for taking the 
time here. Very much appreciated.

"Daniel Pineault" wrote:

> I could be wrong, but it seems like access isn't understanding that the 
> fields are numeric values.  Perhaps you could try something like:
> 
> =CDbl([Q1])+CDbl([Q2])
> or
> =CInt([Q1])+CInt([Q2])
> ...
> 
> Use the appropriate conversion based on your data.
> -- 
> Hope this helps,
> 
> Daniel Pineault
> http://www.cardaconsultants.com/
> For Access Tips and Examples: http://www.devhut.net
> Please rate this post using the vote buttons if it was helpful.
> 
> 
> 
> "Al Morton" wrote:
> 
> > I have created two Option Groups, setting up values against the radio buttons.
> > The output from both boxes works fine (thanks to the Wizard), however when 
> > I'm creating a formula on the report, I'm unable to add the two returned 
> > values together.
> > 
> > If I type in =([Q1]+[Q2])    then I get both numbers concatenated together 
> > (ie returned value from Q1 is 1 and returned value from Q2 is 2, the answer 
> > I get is 12 !!!!.) 
> > 
> > Interestingly if I enter =([Q1]-[Q2]) then I get the correct answer.
> > 
> > Any help would be greatly appreciated here.
0
Utf
1/23/2010 4:36:01 PM
Reply:

Similar Artilces:

How to perform sum sum sum...
How to perform sumation within that particular item but the item is not unique...means item 1 has its own quantity and same goes to item 2...but in the same table... -- Message posted via http://www.accessmonster.com On Tue, 17 Apr 2007 05:28:12 GMT, "EMILYTAN via AccessMonster.com" <u33296@uwe> wrote: >How to perform sumation within that particular item but the item is not >unique...means item 1 has its own quantity and same goes to item 2...but in >the same table... Group By the item. For a more detailed answer, please post a more detailed question (with a des...

Summing up user defined results
Hi all - I'm new to VBA programming in Excel and so any help i'd totally love! I'm currently writing a function. Objective: user can select rows (do not have to be sequential). User clicks on button. UserForm appears with summed results from ONLY rows that he selected. What I have now, well it doesn't work: Sub Button6_Click() Dim i As Integer Dim totalNumbers As Integer Dim aRange As range For Each a In Selection.Areas 'MsgBox "Area " & i & " of the selection contains " & _ ' a.Rows.Count & " rows." &...

HELP
I'm desperate for help. We just did an exchange 2003 email install with internet connectivity (SMTP mail). I just noticed that there are several hundred thousand reports of badmail. I stopped the smtp service, cleaned out the queue, pickup, and badmail (del *.* in all). Then, I re-enabled outbound (SMTP). the queue quickly fills up and grows from just a couple of delivery queues for internet destinations to several hundred queues with a couple hundred mails in each. If i try and 'find message' and view the properties on one of them, they all say 'message from postmaster@m...

Null value won't pass into function
Hi All, I have started tearing my hair out over this problem! I am pulling some data from a table and passing it as variables into a function in Access. One of the variables I'm passing through can be Null, so to avoid trying to pass a Null value to a function as a string (which I gather Access wouldn't like) I created an IIF function inside the parameters so if the value was null, it passed the string "NULLDEPOT" into the function, and I dealt with it inside the function. No matter HOW I try (stacked queries, new variables, taking the IIF out of the function parameters an...

Multiple variables to sort and sum, return values<0 with sum refer
Can anyone help me with this one please? I have this table of data. I'd like to be able to write a formula(s) which sums the No according to date and code, but then only returns a sum value (with the code and date in the two adjacent cells) if there is a value greater than 0. Code Ref No Date 1 G/032/05/999 400600 212 19/03/2010 2 G/032/03/001/999 400500 50 19/03/2010 3 G/032/02/001/001 400400 170 19/03/2010 4 G/032/05/999 400600 315 19/03/2010 5 G/032/03/001/999 400500 300 19/03/2010 6 G/032/05/999 400600 202 19/03/2010 7 G/032/03/001/002 40...

sum subform to form
=Sum([Forms]![frmCamPledgeList].[frmCamPledgeListSub].[Amount Pledged]) Form (frmCamPledgeList) with subform frmCamPledgeListSub). Subform has a field named Pledge Amount. I want to put a field on the form that gives me a total of the subform's Amount Pledged. I have tried the above, but I get an #error in the unbound text box. Do you need any more info? Any thoughts on why this does not work? Thanks in advance, Scott -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/200912/1 The proper syntax is =Sum([Forms]![frmCa...

Calculate sum of a field within the query
I have a query that returns the details for a failure record during a specified time period. Where if I search between 1/1/08 and 1/31/08 the query returns the records of all failure records during that period. The row shows the part number and the total parts failed for that record. I need the query to then sum the total part failures for the previous 12 months. So I would see the following: Record # | part # | parts failed | Origination Date| Total Parts failed past 12 months 44444 | x | 4 | 1/2/08 | 200 44445 | Y |1 ...

Mr Reed, Please help !!
Hi all and especilally Mr Reed, Two questions 1. I now have Outlook 2003 and when I start to type in a email address into the To: field, the auto-fill kicks in and a list of likely suspects shows up. Has anyone worked out - Where this list is stored ? How to copy / paste (or transfer or convert) all those addreses from that list into my Contacts address book ? 2. There used to be an option where my recipients, (anyone I wrote or replied to) would automatically be copied into my address book. That option seems to have disappeared. Anyone know where it went ? TIA Bobbie ...

Need help with SQL statement
Hello, I need to do the following: The Item price must be copied to Pricelevel C as back-up. Next the price entered in Pricelevel A must be copied to Item price Is this possible thrue an SQL statement? I don't have SQL knowledge, so I hope you can help me. -- Kind regards, Raymond Bakker ReBuS b.v. The Netherlands BACKUP FIRST. If at all possible, perform these operations when the store is closed. In Store Operations: UPDATE Item SET PriceC = Price then... UPDATE Item SET Price = PriceA If you are in an HQ environment, you'll need a different set of queries. Tom -- St...

help converting table structure
hi - i'm a teacher and am after some help changing the structure of a large table. i am given every few weeks an excel table with the structure Columns: Admin RedMon RedTue RedWed RedThu RedFri BluMon BluTue BluWed BluThu BluFri The Admin is a number assigned to each pupil in the school (1400 on role) In the RedMon, RedTue etc columns is a room number. I could do with the structure of the table being changed to the following Admin Cycle (Red/Blue) Day Room So that each pupil will now have 10 entries (one for each day of the 2 week cycle) ...

how to make this work if sum=5+n2 then sum becomes the value of s.
I want to get or create a formula in excel or access that allows me to keep a running total of my supplies ie... I have 2 pens, remove one and receive 2. answer in the cell becomes 3 pens then if I zero out the received cell the inventory cell still remembers that I have 3 pens not 4 pens (because I received 2 more pens) and visa versa when I zero out the received cell it remembers I have 3 pens not 1 pen(because I removed 1 pen) I believe the method you suggest is flawed. You have no audit trail. If the number on the sheet doesn't match your actual inventory, how will you figure out...

=SUM Ranges Do Not Update
I have a Excel 2000 spread sheet, with the following macro to insert new row. Sub InsertRow() ' ' Macro1 Macro ' Macro recorded 4/27/2004 ' 'GoTo label, MyString ActiveSheet.Unprotect Application.Goto Reference:="MyCell" ActiveCell.Select ActiveCell.EntireRow.Insert ActiveCell.Offset(-1, 0).Select ActiveCell.EntireRow.Copy ActiveCell.Offset(1, 0).Select ActiveCell.PasteSpecial xlPasteAll Application.CutCopyMode = False ActiveCell.Select ActiveSheet.Protect DrawingObjects:=True, Contents:=True Scenarios:=True End Sub The problem is that in the "Mycell&qu...

Help Needed!
1. I created a protected worksheet that has users enter a date in an unprotected cell. Once the user has entered the date, they must Control +c to run a macro which is an autofill for a two week period. The macro actually unproctects the data range, completes the autofill an then protects the range again. Is there any other way to have the auto fill without the user input of Control C. 2. In the same worksheet can I allow user input into a range but protect the formatting..for example - If I drag and drop from a cell with shading to a cell with no shading ..the shading is moved as well Thank...

Receiving email (Help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!)
When im half way through receiving a list of emails I loose my internet connection, as I have a dodgy phone line. I then have to press send and receive again because obviously I get an error on outlook express and when I click send and receive it starts from the begining of the list again. This has been going on for months now and ive got a list of about 11000 emails waiting to come through. Any ideas on what I should do? Is there any way of each time you click send and receive it starts from where it got upto last time e.g 30 0f 11000? Please help!!!!!!!!!!!!!!!! Cheers Steve ...

Custom Functions in an Add-in
I work in an office using Excel 2007 and we have created a few custom functions and saved them as an add in within Excel (i.e. with extension .xla). The custom functions work fine, but we would like to have them available to all users on our local network. We currently do this by having local copies of the .xla file on each machine, however the .xla file is often updated and it is a pain making sure everyone is running the most up to date version. I have tried pointing each users' Excel at a single version of the .xla file on our server, but this slows Excel down significantly on loadin...

Sum value between dates problem driving me mad!
Good Evening All, I am really struggling here, have tried, nested IF's including AND's but am a bit stumped. I am fairly familiar with Arrays, but cannot seem to combine all. I have a data table (as detailed below). (Hopefully, this should be 'pastable' into Excel - it works for me) I simply wish to calculate the expected totals per month. Any help & assistance with this would be most welcome. Cheers, Mathew Note, earliest Start is 01/04/03 Start Finish Day Rate Apr-2003 May-2003 Jun-2003 Jul-2003 Aug-2003 01/04/2003 23.00 01/04/2003 09/07/2003 23.00 ...

Conditional Sum Wizard
Currently I am setting up a sheet and I am using the conditional sum wizard for formulas. Once a formula is created the sytem won't let me copy or change a formula. If I try to copy (Copy, paste special) a formula to another cell, the formula won't work anymore. If I create a formula with the wizard and afterwards change one of the parameters, the formula does not work anymore. Can anyone give me a hint on how I can solve these issues? Thanks. Please don't multi-post - you have an answer elsewhere, relating to use of CSE. Pete On Jan 6, 9:23=A0am, MarcoKoenders <MarcoKo...

Reports non-functional
I am currently running CRM 3.0. I have two servers, one running SQL 2000 SP4 and one running CRM. On the local CRM server, I am able to access the CRM web Client and select reports to open the reports viewer. When I select to run a report, it prompts me for log on. Once I log on it gives me access to run reports. When accessing with the web client from a workstation on the internet and access run reports, it gives me this page cannot be displayed. During this process, I noticed that it was attempting to connect to http://SQL/reportserver. What am i missing? I verified kb on separate s...

Help with Weekly Personel Schedule
Hey everyone, I've been using Excel to create the weekly schedule for my department at work (roughly 8-10 people), as well as daily assignment sheets that list the people on, hours working, and an hour-by-hour breakdown of their job responsibilities. Because the hours available to my department, as well as the tasks required for completion, vary week to week, I create my schedule from the daily assignment sheets, and then transfer my work over to a weekly schedule grid (consisting of simply the name, date, and time of their shift) for posting in our back office. Example ...

Sum Question
I am using Excel 2000 I have the following very simple formula in column j Sheet1 =SUM(B5*H5) I have this copied all the way down to line 40. It shows 0 in all of the cells all the way down. I would like for there to be a way that the cell would not show anything in it UNLESS there was something that it was calculating. For example. I have entered data in column b and column h through line 10, but it still shows 0 in column J all the way down to line 40. I realize that it is showing these 0's b/c I have placed the formula there, but is there a way that it will still calculate but only ...

Sum sum sum
Let me describe my problem... I have a form with with item number with is unique and then i put another form (subform) to linked to record the number of item in and out.... This means a item can have many in and out transactions which make the item number not unique.. My problem is I want to calculate the sum of in quantity within the same item. I want the sum to be keep on increasing when the user enter the quantity. Example user key in 2 then new user key 4 and i want the total quantity to be 6... Please help.... No idea of what i am talking? I will explain... -- Message posted via http:/...

Taking sum of a field from sub report
Hi On a sub report I have a field datetot which is the sum of two fields those two fields are in turn coming from two further sub reports of the sub report. How can I take the sum of datetot field to the main report? Thanks Regards See: Bring the total from a subreport onto a main report at: http://allenbrowne.com/casu-18.html -- 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. "John" <John@nospam.infovis.co.uk> wrote in message news:OCWbU...

Problem with copy/paste function
Hello, I've been using Publisher for 3 1/2 years - taught myself how to use it, and I've gotten fairly proficient. But, I'm having a problem that's never occured before. First off though, I am on a networked system. Most of the files I use are on the server which everyone has acccess to. We are all using the same version of Publisher (2000 v.6.0) I was given a new hard drive in June by the church board of trustees - nice, huh? It's much faster than my old one and I've had relatively few problems except for this one I'm dealing with for Publisher. Ever s...

ALTER COLUMN Help
I previously submitted a post but was never answered. I must be because I stated it worked but wanted input how it could be simplified. However, I moved on without the simplification and I am moving forward writing it for each field. What I need to do is to have a Form where I set the default value of the field in the table for several fields. I only found that the way to do it is using ALTER TABLE...ALTER COLUMN. In my form, I am using an unbounded text box and I named it 'CField1'. At the beginnning I tried the code shown below and it works, but only if the text entered in CField1 h...

Adding Sum
I made a query report with unique records to display,I don't want repeating item displayed in the report. What should I do to sum the other qty delivered in a single item. Item Qty Date Pork 50 08/01/05 60 08/10/05 20 08/15/05 should be Item Qty Date Pork 130 08/01/05 - 08/15/05 thanks & Godspeed. One way Sub Test() Dim iLastRow As Long Dim i As Long Dim dteMax As Date Dim dteMin As Date Dim...