G
Guest
Hi
Im stuck. I'm writing a query which summarises a previous query, but grouping items based on categories and summing values. Nothing complicated but required to summarise a relatively large access data base with lots and lots of little calculations
Unfortunately on one field it comes up with a "data type mismatch in criteria expression" error and won't run. The rest i can get to sum, but not this field. I have checked and changed the format for the field as 'currency', I've times the contents of the field by a value of one (just in case it wasn't being recognised as a number - it works for problems like this in excel)
The actual field is based on three other fields where it has a large iff function based on utilising the field which is not null (presuming the others are null) or if all three fields are null then return a $0 value
the expression is like this
T_Freight: 1*(IIf(IsNull([Tariff1]) And IsNull([Tariff2]) And IsNull([Tariff3]),0,IIf(IsNull([Tariff1]) And IsNull([Tariff2]),[Tariff3],IIf(IsNull([Tariff1]) And IsNull([Tariff3]),[Tariff2],IIf(IsNull([Tariff2]) And IsNull([Tariff3]),[Tariff1],-9999999))))
akward i know, but i couldn't seem to do a minimum of those fields and thought it might have been due to the blank cells
so any ideas on how and where i could find the source of the error to fix
thanks
Marcus.
Im stuck. I'm writing a query which summarises a previous query, but grouping items based on categories and summing values. Nothing complicated but required to summarise a relatively large access data base with lots and lots of little calculations
Unfortunately on one field it comes up with a "data type mismatch in criteria expression" error and won't run. The rest i can get to sum, but not this field. I have checked and changed the format for the field as 'currency', I've times the contents of the field by a value of one (just in case it wasn't being recognised as a number - it works for problems like this in excel)
The actual field is based on three other fields where it has a large iff function based on utilising the field which is not null (presuming the others are null) or if all three fields are null then return a $0 value
the expression is like this
T_Freight: 1*(IIf(IsNull([Tariff1]) And IsNull([Tariff2]) And IsNull([Tariff3]),0,IIf(IsNull([Tariff1]) And IsNull([Tariff2]),[Tariff3],IIf(IsNull([Tariff1]) And IsNull([Tariff3]),[Tariff2],IIf(IsNull([Tariff2]) And IsNull([Tariff3]),[Tariff1],-9999999))))
akward i know, but i couldn't seem to do a minimum of those fields and thought it might have been due to the blank cells
so any ideas on how and where i could find the source of the error to fix
thanks
Marcus.