473,387 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to divide a field

I am trying to divide a field in my Access query. Below is what I have so far. But, something is wrong I get an error.


PAID : (Sum(IIf([ildoc],1,0))/([ilPaid]/100))

I am primary trying to divide the "Paid" field by 100.

Thank you,
John
Jan 19 '18 #1
6 4644
Seth Schrock
2,965 Expert 2GB
When you say, "I get an error", what exactly are you getting? Does the query return #Error for that field, does a message come up stopping the query from running? Do you get a message about an aggregate query or fields not included in the Group By clause? Please let us know exactly what occurs and the exact wording of any error messages.
Jan 19 '18 #2
gnawoncents
214 100+
As Seth mentioned, the fix largely depends on the error. Also, however, it depends on what you're trying to achieve. Based on the current parentheses placement, you are trying to get the sum of all the ildoc fields as a 1 or 0 result (returning 1 if anything is present and 0 if the field is blank). Then it’s trying to divide that by a single ilPaid field (divided by 100), which is probably giving you an aggregate function error. In other words, it can’t reconcile using all records for one part of the formula, but only one record (which one? = Error) for another part.

Look at your formula again and make sure it’s set up to do what you want.
Jan 23 '18 #3
Thank you for the information. I was able to divide by the ILPAID field. Am still trying to write formula to subtotal by ILDOC field.
Jan 23 '18 #4
gnawoncents
214 100+
John,

Are you still having trouble, or were you able to find a solution? If you still need help, please provide details on where you're at with the coding and what you're specifically trying to achieve.
Jan 26 '18 #5
I have solved the problem on dividing in a field. But, am now trying to create SQL to subtotal by each ILDOC number by the transaction amount, field ILPAID. Both fields are type "number". I am basically just starting to trying to write formula. Thanks, John
Jan 26 '18 #6
NeoPa
32,556 Expert Mod 16PB
@John.
If you need another question to be answered then you'll need to post it separately. Multiple questions in the same thread are not allowed and will be deleted.

It's perfectly permissable to post links between threads if you feel that may help.
Jan 26 '18 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Jack Smith | last post by:
Hello, I am working on the following problem. I need a divide and conquer algorithm to solve the following problem. Any help is appreciated. I have a set of coordinates (x,y) and each...
6
by: Sami | last post by:
Problem: Social Security number being used in a database. First problem is that it will not permit numbers beginning in zero to be entered - it sees it as a null or empty space from what I can...
1
by: stuart | last post by:
I am trying to format a number in an unbound text field using the following format statement in the field's Exit event: txt11UnitWeight = Format(txt11UnitWeight, "00000.00") I want the number...
8
by: shumaker | last post by:
I see other posts where some say fields that will hold a number with leading zeros should be stored as text instead of numbers. This is very inefficient though, as a string of digit characters...
5
by: Otie | last post by:
I have a select query that groups records together, specifically baseball players and their home runs and at-bats. I want to create a query that displays , , and and that sorts ASCENDING on the ...
1
by: ChrisFrohlich | last post by:
ASP.NET 2.0 with Text DataTypes: I've got a similar question going in the SQL group, but I was wondering if anyone has successfully implemented reading/writing character data from a Text datatype...
31
by: MRHIGHSPEED | last post by:
Hi all. I'm new here and fairly new to building databases. Learned a lot in designing this one, but I am stuck on this one last expression. I'm trying to create a calculated control. The form is...
5
by: somanyusernamesaretakenal | last post by:
Hi Everyone, I am working with Access 2003. Let's say I have a field on my Main table, it contains the city name and the postal code in brackets. How do I make it so I could either delete all the...
5
by: kashman | last post by:
Hello, I am hoping this is an easy question for someone out there. I am running a query where I am dividing (fieldA/fieldB), there are instances where Field A and Field B have a zero value. ...
20
by: FaurKris | last post by:
I found that there is something like Sum(), and I get that.... I have two columns that are populated via check boxes on the form called 'Sent' and 'Signed'. Once checked, the value in the table...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.