473,396 Members | 1,871 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,396 software developers and data experts.

Multiplying fields to produce Discounted Price Rates by Customer

Hi

I am attempting to create a pricelist to give to my customers, however I have become lost in the complexity of the query I am trying to perform and could really use some help.

The database is a relatively simple one set up in Microsoft Access 2007 and consists of 4 tables. The query in question should only deal with two of them, the PriceList table and CustomerDiscounts table. Currently each product in the PriceList table is assigned to a product type (ProductCatagoryNo) and each customer has different discounts for each catagory of products which is represented in the CustomerDiscounts table as CustCode, ProductCatagoryNo, DiscPer (the discount percentage).

What I would like to have output is the ProductDecription and Price, where Price is the Sale Price (PriceList.Retail1) less the Customer's discount percentage (CustomerDiscounts.DiscPer) and have this done for each customer in my database, listed ascending by ProdNo but that field doesnt need to be shown.

Edit: It becomes slightly more complicated in the fact that Customer's do not have a discount associated with every catagory of products, so where there is no entry for a given product's catagory under the CustomerDiscounts table it should list the sale price as is (Retail1).

Edit2: Im not terribly familar with Access but I think that the report function might be able to give me the results im looking for?
Any help would be greatly appreciated!
Attached Images
File Type: jpg relationshipf.jpg (10.4 KB, 275 views)
Apr 21 '10 #1
6 2085
TheSmileyCoder
2,322 Expert Mod 2GB
@TimberSales
Any chance you could attach your database here? It would make it alot simpler to write out the query.
Apr 21 '10 #2
@TheSmileyOne
Hi TheSmileyOne,

Yes I should be able to post it... Just give me a bit to remove some of the more sensitive information.

Thanks for the assistance!
Apr 21 '10 #3
TheSmileyCoder
2,322 Expert Mod 2GB
@TimberSales
Sounds good. I will be going for lunch anyways, so you have some time :P
Apr 21 '10 #4
NeoPa
32,556 Expert Mod 16PB
What you should be looking to do here is to join the two tables using a LEFT JOIN (See SQL JOINs for more on this). Where the linked table on the right (that is joined to) has no entry all the fields for that table will contain a value of Null.

The discounted value can then be calculated as the [retail price] * (100 - Discount) / 100, where Discount is actually Nz([Discount], 0). This means that where there is no entry for [Discount] the deduction will be 0.

Welcome to Bytes!
Apr 21 '10 #5
Sorry for the slow response very busy day,

I have cut out 99% of the information from the DB such that it should be easy to understand and work with.

Thanks again for the help!


@Neopa Had a play around with your suggestion, managed to get a good way towards what I was after, will give it another try later tonight!
Attached Files
File Type: zip PricelistTEST.zip (46.5 KB, 63 views)
Apr 22 '10 #6
NeoPa
32,556 Expert Mod 16PB
If you can't manage to solve it fully then let us know how far you do get and we'll see what we can do to help.

Good luck :)
Apr 22 '10 #7

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

Similar topics

1
by: Rock | last post by:
Hi, I have been asked to create a web site for a new small budget magazine. This is my business and have been doing it for 8 years but with a web site project with a certian amount of pages,...
4
by: Sven Seljom | last post by:
I want to take the value from one form-field, deduct the VAT and return the value in another form-field. I have made a Public Function for this and attached it to the text-box. Can anybody help me...
1
by: Dave | last post by:
This one's pretty basic, but I really need help. I have two tables, one with customer information and another which looks up prices depending upon size in united inches. It works fine if I...
2
by: jho | last post by:
hello, I have a pricing sheet form and have the following fields in one row: SKU DESC UNIT PRICE QTY PRICE I want to select the sku in the form and have the corresponding desc and unit...
8
by: plemon | last post by:
alright here is what it is: a computer site where customers build custom system by selecting from forms and radio buttons. what is needed: a database (MySQL) with php basicly... 1 users...
2
by: Jimmy | last post by:
Here's my issue. I'm using a calculated control to combine two fields on a form & report. The two fields are RecordID (the autonumber primary key) and a field named ProductCost. The idea is to...
0
by: mareeus | last post by:
Hi all, I need to think of a complex way of searching data in a table and also create a scoring system and display results considering their score. I need to keep some tokens and also need to...
1
by: beechclose | last post by:
Hi I have a table called tbl_Products which stores details of available products including current price. I have a second table called tbl_chosen_products which stores the product id and quantity...
7
by: creative1 | last post by:
Hello everyone. I am experiencing a strange problem that I can't fix on my own. I think I need expert's suggestions for this. The problem is: I want to print account statement (or any other...
3
by: printline | last post by:
I am need of a simple price calculation script that will give users a price on a Printed Circuit Board. Here is an example: I have a panel that is 18 dm˛. A customers wants 1 PCB that is 100mm...
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: 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...
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
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,...
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
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.