rogers5293
New member
- Local time
- Today, 05:08
- Joined
- Oct 25, 2011
- Messages
- 4
I have several calculated fields in a query that work fine. I have two that have conditions on them and was wondering if you CAN'T have IF statements in a calculated field query. If not, how do I do this?
I have two tables. One is a product table and one is a rates table. If the calcuated field has less than 2.00 as the value then 2.00 needs to be defaulted as the value. (If it is less than $2.00 they want to charge a minimum fee)
cFeeCalc: [TableName].[NbrofProducts] * [Rates].[DistFee]
^^this works fine but if it is less than 2.00 I need to default the vaule to 2.00
cFeeCalc: IFF([TableName].[NbrofProducts] * [Rates].[DistFee] < 2.00,2.00,[TableName].[NbrofProducts] * [Rates].[DistFee])
^^this does not work at all but is what I need
-------------------------------------------------
The other calculated field needs to determine if a value from one table is "L" then use a fee from the rates table but if the value is "S' then use a different fee from the rates table.
Logic: IFf([TableName].EnvelopeSize = "L",[TableName].[EnvelopeNbr] * [Rates].[LargeEnvFee],[TableName].[EnvelopeNbr] *[Rates].[SmallEnvFee])
I would appreciate any help!!!!!! I am stuck!!
I have two tables. One is a product table and one is a rates table. If the calcuated field has less than 2.00 as the value then 2.00 needs to be defaulted as the value. (If it is less than $2.00 they want to charge a minimum fee)
cFeeCalc: [TableName].[NbrofProducts] * [Rates].[DistFee]
^^this works fine but if it is less than 2.00 I need to default the vaule to 2.00
cFeeCalc: IFF([TableName].[NbrofProducts] * [Rates].[DistFee] < 2.00,2.00,[TableName].[NbrofProducts] * [Rates].[DistFee])
^^this does not work at all but is what I need
-------------------------------------------------
The other calculated field needs to determine if a value from one table is "L" then use a fee from the rates table but if the value is "S' then use a different fee from the rates table.
Logic: IFf([TableName].EnvelopeSize = "L",[TableName].[EnvelopeNbr] * [Rates].[LargeEnvFee],[TableName].[EnvelopeNbr] *[Rates].[SmallEnvFee])
I would appreciate any help!!!!!! I am stuck!!
Last edited: