Hi Dennis,
Thanks for responding. It's not quite that simple, "my code field" is in a
table of prices and contains a list of codes which relate to various products.
However, the product quantity is calculated in different ways depending upon
the type of product. Quantity is size dependent also. The calculations are
sometimes individual items that go to make up the product, square metres, or
just metres. There are several codes that relate to each type of measure
(quantity).
The price calculations are not necessarily straightforward either, although
I've got the method for those sussed, but this means that I need as simple a
way as possible to calculate the quantities. I'm no mathematician and
following too many brackets makes my brain hurt - and can be complicated to
come back to at a later date to see what you've done.
Would it be easier to have a "categories" table and/or run several queries?
But would that involve a macro or VB and how?
Crazy Lady
Dennis said:
Make the column in your query like this
NameofColumn: IIf([YourCodeField] = "SpecificCode",YourCalculation,0)
:
I want a query with fields that will either perform a caluclation dependant
upon the value of a "code" in an underlying table, or return zero if the
record does not contain the specified "code"