Can"t get the right result

Can"t get the right result

am 09.11.2007 20:46:03 von PJ

Hi,

Here is my problem (I posted a similar problem a few days back and changed
my DB structure but I am still stuck)

Here is the structure:

1) ProductTable (ProductID, and other product infos)

2) Sales main Table (SalesID, date ot the sale, salesperson and a portal
with informations on salesTable) - salesID is unique and automatically
generated (just like a Invoice Number)

3) SalesTable (ProductID, SalesID, and other sales information) - most of
these infos are entered from the portal that is in the Sales Main Table

4) Sales people Table (salesID, salesperson) so for each salesID I have a
sales person associated

The relationships between Tables are as bellow:

ProductTable is linked to Sales Table with ProductID

Sales main Table is linked to Sales Table with SalesID

SalesTable is linked to Sales People Table with SalesID

Basicaly, on the Sales main Table, I enter all the infos about the sales,
the date, the sales person, and in the portal (to salesTable) I enter each
product, the price, the number of products etc...

what I want to do to show (somewhere - I thought the product Table is the
best) what each sales person has sold for each product. So on each product
page, there is a number of what has been sold by each sales person for that
product

Is that possible ? I am aware that my DB may not be constructed very well,
but can I still see this information ? What formula should I use ?

Thanks for any help.

Re: Can"t get the right result

am 09.11.2007 23:51:02 von bill

In article <4734b8dd$0$25926$ba4acef3@news.orange.fr>,
"pj" wrote:

> Hi,
>
> Here is my problem (I posted a similar problem a few days back and changed
> my DB structure but I am still stuck)
>
> Here is the structure:
>
> 1) ProductTable (ProductID, and other product infos)
>
> 2) Sales main Table (SalesID, date ot the sale, salesperson and a portal
> with informations on salesTable) - salesID is unique and automatically
> generated (just like a Invoice Number)
>
> 3) SalesTable (ProductID, SalesID, and other sales information) - most of
> these infos are entered from the portal that is in the Sales Main Table
>
> 4) Sales people Table (salesID, salesperson) so for each salesID I have a
> sales person associated
>
> The relationships between Tables are as bellow:
>
> ProductTable is linked to Sales Table with ProductID
>
> Sales main Table is linked to Sales Table with SalesID
>
> SalesTable is linked to Sales People Table with SalesID
>
> Basicaly, on the Sales main Table, I enter all the infos about the sales,
> the date, the sales person, and in the portal (to salesTable) I enter each
> product, the price, the number of products etc...
>
> what I want to do to show (somewhere - I thought the product Table is the
> best) what each sales person has sold for each product. So on each product
> page, there is a number of what has been sold by each sales person for that
> product
>
> Is that possible ? I am aware that my DB may not be constructed very well,
> but can I still see this information ? What formula should I use ?
>
> Thanks for any help.

See my response to your earlier message. You have the relationship of
people to sales backwards.