Multiplying from two different tables

Nytefall

New member
Local time
Today, 16:30
Joined
Jun 3, 2013
Messages
2
This is quite an annoying problem that I have run into with my work on this database. What I want to do is have the sum of a customers purchase on one table, however the values needed to multiply are on two different tables. I will post some pictures to explain it a little better.But what I want to do is have the Order table multiply the total cost of the cars together.

Apparently I cannot post links so if you can help and need more information I will PM you the pictures.

Basically I have created a relation ship between these two tables Car data and Order data. All of the cars have their own unique primary key which is connected to the order data, what i need is go into the car data table pull the price out and multiply it by the quantity in the order data and put the sum into the Total price. Can i get any help with this?
 
how would this help? How would i be able to implement it into my tables? I actually don't know that much about Sql so that link you sent me to is very confusing.
 
Hmmm, that's the simplest description of JOINS I have come across.. But anyway.. Let me use your words..
Basically I have created a relation ship between these two tables Car data and Order data.
This RELATIONSHIP, is the field that is common to the two fields, in other words both the tables will be LINKED by this one Key field..
NOTE:
If the relationship has been designed using the Database tools, the JOIN would automatically link the two tables when you bring them into a Query..
All of the cars have their own unique primary key which is connected to the order data, what i need is go into the car data table pull the price out and multiply it by the quantity in the order data and put the sum into the Total price.
Since they are LINKED to each other, when you join them, you will be able to PULL the price from the Car table.. Then all you have to do is Create a new field by Multiplying the Car.Price with the Customers.Quantity.. That's all you need to do..
Apparently I cannot post links so if you can help and need more information I will PM you the pictures.
Your post count needs to be a minimum of 10 Posts before adding Hyperlinks/Pics.. If you do want to upload pics, you can ZIP your files and UPLOAD them..
 
back to square one

why would the values be in two different tables?

that sounds like a normalisation issue to me.



This is quite an annoying problem that I have run into with my work on this database. What I want to do is have the sum of a customers purchase on one table, however the values needed to multiply are on two different tables. I will post some pictures to explain it a little better.But what I want to do is have the Order table multiply the total cost of the cars together.


just to clarify what I meant. I orginally thought you meant there were two tables with some purchases in each, but i now realise you mean the purchase details are in one tble, and the prices are in another. (is that right?)

I just can't see why you would have a structure like this - hence the comment that this seemed to be a normalisation issue.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom