|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now! |
|
#1
|
|||
|
|||
|
SQL Syntax
I need to compare the results of 2 queries, the queries in an individual capacity does work, but when combined the totals are incorrect. I am using an access database and programming in visual basic. The database structure is such that there is a product table with a list of all our products and 2 other tables that both reference the products table PLEASE HELP
|
|
#2
|
|||
|
|||
|
I think we can use some more details here.
Can you post the SQL statements. |
|
#3
|
|||
|
|||
|
SELECT Production.ProdCode, Pallets.ProdCode, Products.ProdDesc, Products.PackSize, Products.Category, Sum(Pallets.Quantity) AS PalletQuantity, Sum(Production.Quantity) AS ProductionQuantity, (ProductionQuantity-SumOFQuantity) as DiffUnits
FROM (Products Left JOIN Pallets ON Products.ProdCode = Pallets.ProdCode) Right JOIN Production ON Products.ProdCode = Production.ProdCode Where Production.Date Between ? and ? GROUP BY Production.ProdCode, Pallets.ProdCode, Products.ProdDesc, Products.PackSize, Products.Category; |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > SQL Syntax |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|