I have got 4 tables with the following fields.
Standart Table -> Standard Id, Description, Discipline, Price, Currency
Specification Table -> Spec id, Spec Title
Currency Table -> Currency id, Currency Name, Conversion Rate
Join Table -> Standard id, Spec id
with the following links and relationships
"Price" of standard table linked to "Currency id" of Currency table(M:1)
"Standard id" of standard table linked to "Standard id" of Join Table(1:M)
"Spec id" of Specification table linked to "spec id" of Join Table(1:M)
ie One standard can belong to Many specifications. One specification can belong to many standards.
I have a select query which selects the fields from these tables and the same query is used for a report.
The select query select "Standardid" from the join table and the other details of Standards from the StandardTable, Specificationid from the Join table and other details of Specification from the Specification Table.
The report tries to group Discipines first then the Standards belonging to that discipline followed by the specifications of each standards and then sum the prices of the standards.
My problem.
If i include only tables "Standard" and "Currency" in the query then i am getting the sum of standards correctly.
If i include "Join" and "Specification" tables along with the above tables in the query, then report takes into account the number of specifications and sums the prices of standards accordingly.
ie if a standard has the price $25 and there 2 specifcations belonging to it, then instead of showing the sum as $25, it shows as $50.
I tried to Pick the Standardid from the standard table, but the result is same. I am sure i am doing something stupid with the query.
Can anybody help me to solve the above problem. any ideas or suggestions or solutions will be highly appreciated. If my explanation is difficult to understand i can email the sample db (very small in size)
Regards and Thanks
Charley
Standart Table -> Standard Id, Description, Discipline, Price, Currency
Specification Table -> Spec id, Spec Title
Currency Table -> Currency id, Currency Name, Conversion Rate
Join Table -> Standard id, Spec id
with the following links and relationships
"Price" of standard table linked to "Currency id" of Currency table(M:1)
"Standard id" of standard table linked to "Standard id" of Join Table(1:M)
"Spec id" of Specification table linked to "spec id" of Join Table(1:M)
ie One standard can belong to Many specifications. One specification can belong to many standards.
I have a select query which selects the fields from these tables and the same query is used for a report.
The select query select "Standardid" from the join table and the other details of Standards from the StandardTable, Specificationid from the Join table and other details of Specification from the Specification Table.
The report tries to group Discipines first then the Standards belonging to that discipline followed by the specifications of each standards and then sum the prices of the standards.
My problem.
If i include only tables "Standard" and "Currency" in the query then i am getting the sum of standards correctly.
If i include "Join" and "Specification" tables along with the above tables in the query, then report takes into account the number of specifications and sums the prices of standards accordingly.
ie if a standard has the price $25 and there 2 specifcations belonging to it, then instead of showing the sum as $25, it shows as $50.
I tried to Pick the Standardid from the standard table, but the result is same. I am sure i am doing something stupid with the query.
Can anybody help me to solve the above problem. any ideas or suggestions or solutions will be highly appreciated. If my explanation is difficult to understand i can email the sample db (very small in size)
Regards and Thanks
Charley