david.young Posted January 28, 2009 Share Posted January 28, 2009 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 More sharing options...
MartyrSyx Posted January 29, 2009 Share Posted January 29, 2009 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 More sharing options...
david.young Posted January 29, 2009 Author Share Posted January 29, 2009 Thanks Brad but that doesn't do it either. Funny I thought this might be a common issue, apparently not. Link to comment Share on other sites More sharing options...
MartyrSyx Posted January 29, 2009 Share Posted January 29, 2009 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 More sharing options...
david.young Posted January 29, 2009 Author Share Posted January 29, 2009 I copied and pasted your rule and all it does is give me 15 as a value, like it does'nt see anything else Thanks again for trying Link to comment Share on other sites More sharing options...
MartyrSyx Posted January 29, 2009 Share Posted January 29, 2009 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 More sharing options...
david.young Posted January 29, 2009 Author Share Posted January 29, 2009 Brad All the records had a value. Went back to Excel deleted the dollar sign and it works like a champ. Thanks for the help. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.