5 Replies Latest reply on Aug 7, 2009 4:06 PM by etripoli

# Calculation problems, Should be easy, I am just dumb this morning

### Title

Calculation problems, Should be easy, I am just dumb this morning

### Post

Like my subject line says, this should be easy.  I just don't see it today.

last4 is a text field containing either the last 4 numbers of a credit card or the paypal transaction ID.  Posable values are a 4 digit number, or a 12 digit string, or empty.

Payment type is a text field containing Payment type.  Posable values are Visa, PayPal, or empty

The auto enter caculation for payment type is designed to check if the proper payment type is associated with the field last4.  (Paypal transaction can not be less then 12 digits long.

The calculation is:

`If ( Length ( last4 )  ≤ 4 and Length ( last4 )  > 1 and payment type = "PayPal";  payment type = "Visa"; payment type)`

My intentions are if the field payment type is PayPal and  last4 is a 4 digit number, last4 should automatically revert to Visa.  With the current formula, when last 4 is a 4 digit string and payment type is paypal payment type changes to 0.

Thanks,

Chris

• ###### 1. Re: Calculation problems, Should be easy, I am just dumb this morning
If ( Length ( last4 )  ≤ 4 and Length ( last4 )  > 1 and payment type = "PayPal"; "Visa"; payment type)
• ###### 2. Re: Calculation problems, Should be easy, I am just dumb this morning
The calc. doesn't make sense.  You're including the AND for payment type = "PayPal", when I think you want to exclude that payment type for "Visa".
• ###### 3. Re: Calculation problems, Should be easy, I am just dumb this morning

Mr_Vodka has the correct answer.  It was just a "grammer" error on my part.  I was up too late last night.

Remember my intentions.  If the field payment type = "PayPal" and last4 = any 4 digit string, the field payment type should revert to "Visa"

Thanks for the help,

Chris

• ###### 4. Re: Calculation problems, Should be easy, I am just dumb this morning
Your current test doesnt test for 4 characters though...
• ###### 5. Re: Calculation problems, Should be easy, I am just dumb this morning
So, you're overriding whatever input the user makes into the 'payment_type' field.  Still doesn't make sense, because what happens if a user puts in a 4 digit number into last4, and forgets to put the payment_type in, or spells PayPal wrong?