Hi,
sorry, if i dont explain clearly...
query "order details extended"
SELECT [Order Details].ID, [Order Details].[Order ID], [Order Details].[PO
Number], [Order Details].[Noted 1], [Order Details].[Product ID], [Order
Details].Size, [Order Details].Special_Instruction, [Order
Details].Quantity,
[Order Details].[Qty Order], [Order Details].Unit, [Order Details].[Unit
Price], [Order Details].Currency, [Order Details].[Exchange Rate], [Order
Details].Origin, [Order Details].Lot_Number, DLookUp("[Net_Weight]",
"Products","[ID] = " & [Product ID])*[quantity] AS [Nett Wt], ([Nett Wt]
*10/100)+[Nett Wt] AS [Gross Wt], [Order Details].[Noted 2], [Order
Details].
[Status ID], [Order Details].[Date Allocated], [Order Details].[Purchase
Order ID], [Order Details].[Inventory ID], [Order Details].Discount, CCur(
[Qty Order]*[Unit Price]*(1-[Discount])) AS [Extended Price], [Order
Details
Status].[Status Name], CCur([Qty Order]*[Unit Price])*[Tax Rate]/100 AS
Expr1,
CCur([Qty Order]*[Unit Price])*[Tax Rate]/100+CCur([Qty Order]*[Unit
Price])
AS Expr2, Customers.*, Orders.[Tax Rate], Orders.[Shipped Date],
([Extended
Price]*[Exchange Rate]) AS [Total Sales]
FROM (Customers RIGHT JOIN Orders ON Customers.ID = Orders.[Customer ID])
LEFT JOIN ([Order Details] LEFT JOIN [Order Details Status] ON [Order
Details]
[Status ID] = [Order Details Status].[Status ID]) ON Orders.[Order ID] =
[Order Details].[Order ID];
query "order price totals"
SELECT [Order Details Extended].[Order ID] AS OrderID, Orders.[Customer
ID],
Orders.[Shipped Date], [Order Details Extended].Currency, [Order Details
Extended].[Tax Rate], Sum([Order Details Extended].[Extended Price]) AS
[Price Total], [Order Details Extended].[Exchange Rate], ([Extended
Price]*
[Exchange Rate])+(([Extended Price]*[Exchange Rate])*[Order Details
Extended.
Tax Rate])/100 AS [Total In SGD], ([Extended Price]*[Exchange Rate]) AS
[Total Amount], (([Extended Price]*[Exchange Rate])*[Order Details
Extended.
Tax Rate])/100 AS [Tax Amount]
FROM [Order Details Extended] INNER JOIN Orders ON [Order Details
Extended].
[Order ID] = Orders.[Order ID]
GROUP BY [Order Details Extended].[Order ID], Orders.[Customer ID],
Orders.
[Shipped Date], [Order Details Extended].Currency, [Order Details
Extended].
[Tax Rate], [Order Details Extended].[Exchange Rate], ([Extended Price]*
[Exchange Rate])+(([Extended Price]*[Exchange Rate])*[Order Details
Extended.
Tax Rate])/100, ([Extended Price]*[Exchange Rate]), (([Extended Price]*
[Exchange Rate])*[Order Details Extended.Tax Rate])/100
HAVING (((Orders.[Shipped Date]) Between #1/4/2010# And #1/31/2010#));
the query "order price totals" that give me the wrong figure. I use this
query to make report.
tbl design as below:-
tbl "order details"
ID order ID Product ID Quantity Qty Order Unit
Price
Exchange Rate Discount
(autono.) (number) (number) (number) (number) (currency)
(currency) (number)
1 1000 1 1 1
1105 1.385 0
2 1000 2 1 1
1105 1.385 0
Noted : Quantity = is for inventory, Qty Order is for Invoice
I just TRY to change price in below tbl, and it give me the correct figure
in
query "order price totals"..that puzzle me..cos i got a lot of records so
far
no problem...only this that records that give me headache.
ID order ID Product ID Quantity Qty Order Unit Price
Exchange Rate Discount
1 1000 1 1 1
1104.50 1.385 0
2 1000 2 1 1
1105.50 1.385 0
Tq
coco
Tom said:
Hi Coco,
As others have said, please copy the SQL (Structured Query Language)
statement for your query and paste it into a reply. If your query includes
other queries as sources of data, then paste the SQL for those queries as
well. It would also be helpful to give us some table design data (name of
table and names & data types of fields), along with some sample data.
Is there any chance that you have the Totals button pressed (which will
add
a Group By clause to the SQL statement)? If I understand you correctly,
this
data gives you 1/2 of the expected result:
ItemNo Price Discount
1 1105 0
2 1105 0
but this data gives you the correct result:
ItemNo Price Discount
1 1104.99 0
2 1105.01 0
If this is true, then it sure appears to me as if two records are being
grouped into one, because you do not have any other unique field present.
Do
you even need the Group By, assuming you have it enabed?
Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
__________________________________________