gearhead03
Technical User
I am trying to set up an IF statement. I have done this type thing before but for some reason I just can't seems to get everything to work correctly.
The fields are:
Miles - Numeric
Weight - Numeric
Rate - Currency
RateType - Text
The first Condition is:
RateType = "Flat" then BaseRate = Rate
The second Condition is:
RateType = "Cwt" then BaseRate = (Weight*.100) * Rate
The Third Condition is:
RateType = "P/Mile" then BaseRate = Miles * Rate
with a final else to set to 0 if none of the previous conditions are met.
I want to use this to set a field on a form to display the "baserate". Would also like to have a module to use throughout the database. (queries, forms, etc.). I must just be having a bad day. I just kept getting errors when I tried to set it up. Mostly Syntax items I am sure.
Mark A. Kale
The fields are:
Miles - Numeric
Weight - Numeric
Rate - Currency
RateType - Text
The first Condition is:
RateType = "Flat" then BaseRate = Rate
The second Condition is:
RateType = "Cwt" then BaseRate = (Weight*.100) * Rate
The Third Condition is:
RateType = "P/Mile" then BaseRate = Miles * Rate
with a final else to set to 0 if none of the previous conditions are met.
I want to use this to set a field on a form to display the "baserate". Would also like to have a module to use throughout the database. (queries, forms, etc.). I must just be having a bad day. I just kept getting errors when I tried to set it up. Mostly Syntax items I am sure.
Mark A. Kale