Calculating Sum in Query

vendredi 17 avril 2015

Hi All,



I have been working on a stock database for my company. It needs to hold stock data, Any adjustments in the storesperson may do (QtyIn or Out). And allow Customer PO's to be raised (just to show prices and quantites sold to customers)



I have 4 Tables:



tblStockList

PartNumber (Primary Key)

Description

Location

StockCheck

StockListUnitPrice

PriceUpdate



tblAdjustments

AdjustmentID

PartNumber

DateAdj

QtyIn

AdjPONO

QtyOut

AdjContractNo

QtyTotal (Calculated from QtyIn-QtyOut)

Notes

AdjPerson



tblCustomerPO

POID

PONo

CustomerName

Person

RigNo

PADNote

ComInv

POComplete (Yes/No)

CurrencyPO

DatePO

ContractNoPO



tblCustPoPN (subform for customer PO)

PoSubID

PartNumber

Quantity

Supplier

SupplierPoNo

ContractNo

Shipped (Yes/No)

Currency

PricePerUnit

TotalPrice (Calculated Quantity x PricePerUnit)

ShippedDate



I then want to create a query to work out the total stock.



At the moment i have two queries, one to Sum the adjustments and one to sum the PO's. (The stock is not removed from the Customer PO until invidual line is shipped)



I then need to combine both these queries to work out the total stock value.



There will always be a value in the Sum of Adjustments but not in the Customer PO. So when i run the query to =SumofAdjustments - SumofCustomerPO's, if there is no record in the SumOfCustomerPo's, no value will appear.



Is there any way i can solve this?



Sorry if i haven't explained it very well. :banghead:



I can attach my current database if that helps?

Calculating Sum in Query

0 commentaires:

Enregistrer un commentaire

Labels