473,398 Members | 2,088 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,398 software developers and data experts.

Add a Mark-up Percentage field to a query

I figured out how to calculate the Profit field by subtracting the cost from the selling price. Now I need to add another field to my query that will calculate the Profit divided by the cost. I keep getting errors.
Oct 20 '17 #1

✓ answered by NeoPa

Also known as GPM (Gross Profit Margin) this is typically calculated, in a query, as :
Expand|Select|Wrap|Line Numbers
  1. GPM:Round(IIf([Cost]=0,0,([SellingPrice]-[Cost])/[Cost]),4)
Multiplication by 100 is only used when displaying the value. This is better done using the format property. Percents can be displayed, and values are automatically shown as 100 x when shown as percent.

2 2195
MikeTheBike
639 Expert 512MB
Hi

I think we need to see what you have done to calculate the net profit so we have an idea what the error may be.

Generally it would be something like
Expand|Select|Wrap|Line Numbers
  1. PctNetProfit:([Selling Price]-[Cost])/[Cost]*100
You should also check that [Cost] is not zero or null before doing the calculation.

HTH


MTB
Oct 20 '17 #2
NeoPa
32,556 Expert Mod 16PB
Also known as GPM (Gross Profit Margin) this is typically calculated, in a query, as :
Expand|Select|Wrap|Line Numbers
  1. GPM:Round(IIf([Cost]=0,0,([SellingPrice]-[Cost])/[Cost]),4)
Multiplication by 100 is only used when displaying the value. This is better done using the format property. Percents can be displayed, and values are automatically shown as 100 x when shown as percent.
Oct 29 '17 #3

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

Similar topics

1
by: Gx | last post by:
I have this form with the fields: * Product: (drop down combo box) with choices - X, Y * Amount: (currency ) * Balance (currency) I want to associate product X with the percentage...
5
by: Javier | last post by:
I have a field type Date/Time that automatically defaults to Now(). I'm having a problem writing a query that will retrieve all the records for a specific date the user to enters when prompted. I...
4
by: bob hicky | last post by:
I have two tables (RadiationOncologists and EvaluationEntry) and forms for each of the two. My problem is that I have a text box in the RadiationOncologists form that is called Number. This field...
18
kcdoell
by: kcdoell | last post by:
Hello: I have two fields on a table that is displayed on my continous form. GWP = Number Binding Percentage = Text (a value list of 25%, 50%, 90% & 100%) I have a unbound text box that I...
5
by: aewhale | last post by:
I have a monitoring script which I am trying to better understand. One of the queries is built as follows: # delete any rows that expired more than a year ago my $rows = $dbh->do("DELETE FROM...
2
by: MRamaLakshmi | last post by:
Hi, Do any body have validation script for a textfield which is a percentage field where i should be able to enter values between 0.0 to 100.0 if user tries to enter any other value it should...
4
by: Jimmy Jones | last post by:
Hi, My problem is that I cannot run make-table-query with "attachment" field... Is there any workaround? I need to find a way to move attachments between tables together with regular data. ...
2
by: thangarai | last post by:
how can i show a field in gridview as percentage,? that is 12 should be displayed as 12% and 12.4 should be as 12.4%
1
by: webbeacon | last post by:
I have a query that searches 3 multivalue lookup fields (Impact, Implementation and Owners) based on input from 3 combo boxes in a form. When I run the form, it doesn't recognize that the 3 lookup...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.