Hi Anton
In your examp
= if ( field XX > 0, field XX * Field YY,Field XX * Field ZZ)
Ensure that you have the table containing the fields in the query and create
a calculated column (right click and select build). You would need to write
something like this.
Result:IIf ( [TableName]![FieldXX] >0, [TableName]![FieldXX] *
[TableName]![FieldYY] , [TableName]![FieldXX] * [TableName]![FieldZZ] )
Of course change the TableName and field Names to what they really are.
_________________________________________
In an access query you can create calculated columns that will perform
calcuations if certain criteria are true and if they are not tru perform
different calculations.
Like this
Result:IIF([TableName1]![FieldName1]>0,[TableName2]![FieldName2]*[TableName3]![FieldName3],[TableName2]![FieldName2]*123)
The above calculation would ask
If the field called FieldName1 in a table called TableName1 is more than 0
then multiply the contents of the field called FieldName2 in TableName2 by
FieldName2 in TableName3. If the is NOT true then muliply FieldName2 in
TableName2 by 123 (one hundred and twenty three).
The basics are that with an IIF you ask is something true or is it not. If
it is you do "something" and if it's not then do "something" else. Hope this
make sense.
Hope this helps
--
Wayne
Manchester, England.
Anton said:
Hii guys this is my first post here , first of all Thank you for reading this
message and even more is you can help me with this issue .
I am trying to do a querue from various tables and need to include a
computed field which will work like the if command in Excel ie
= if ( field XX > 0, field XX * Field YY,Field XX * Field ZZ)
can some tell me if this is possible and if yes how i should type it ?
Thanking you all
Anton Cini