Jump to content

Doing addition


david.young

Recommended Posts

I need a rule that will return the value of a record pluc a certain amount depending on the value of the record.

So far all I have happening is the values being concatenated

 

if (StringToNumber(Field("tot_renew"))<76.00)

return (Field("tot_renew"))+(15.00)

else

if (StringToNumber(Field("tot_renew"))<250.00)

return (Field("tot_renew"))+(25.00)

else

if (StringToNumber(Field("tot_renew"))>=250.00)

return (Field("tot_renew"))+(50.00)

Link to comment
Share on other sites

I didn't try this out so I'm not sure if it will solve your problem, but try using the "StringToNumber(Field("tot_renew"))" instead of just "Field("tot_renew")" when adding. You have it converting to a number in the "if" line, but not in the return line.
Link to comment
Share on other sites

David,

I tested the following formula out and it works on my end. See if it does for you...

 

if (StringToNumber(Field("tot_renew"))<76.00)

return StringToNumber(Field("tot_renew"))+(15.00)

else

if (StringToNumber(Field("tot_renew"))<250.00)

return StringToNumber(Field("tot_renew"))+(25.00)

else

if (StringToNumber(Field("tot_renew"))>=250.00)

return StringToNumber(Field("tot_renew"))+(50.00)

Link to comment
Share on other sites

Sorry, David, these may be dumb questions...Is the value in the record you are looking at zero? Are all the records returning 15 or just the ones below 76.00? Also, does the field "tot_renew" have a dollar sign or some other alpha character that would keep it from converting to a number?
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...