Nested Queries

livvie

Registered User.
Local time
Today, 22:54
Joined
May 7, 2004
Messages
158
Hi
I want to run a query that returns a calculated field (x*y) which I have done but at the same time I want to do (x*y) for the records that are marked with a flag producing two figures so that I can do two subtotals ? Any ideas. I am doing this on a form using Queries and the subtotals in the footer. Here is what I have so far :

SELECT Matid, est_id, mat_desc, mat_qty, mat_units, mat_cost, switch1, hook1, hook2, mat_spec, buyfrom, External, Delivery, mat_qty * mat_cost AS Costs,

FROM tblctmat
 
I assume you are doing the calculations in a query?
Calculation1: [x]*[y]

If so, why not just add another calculation field
Calculation2: iif([FlagField] = TRUE, [x]*[y],0)
Using 0 will be OK for a subtotal or you could use " " or Null.

Hope this is what you are looking for.
:)
 

Users who are viewing this thread

Back
Top Bottom