Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What's wrong with this formula?

Status
Not open for further replies.

kevnatajax

Technical User
Jun 25, 2002
14
US
I'm using CR7 on foxpro 2.5 dbf and trying to copy this formula and change month = 2. the formula below works for month = 1 but doesn't work for any other months. (data exist in other months) All formulas are in the Detail section.

if (tonumber({Clmanal.MONTH})=1 and (((ToNumber ({Clmanal.CODE}) >=1200) and (ToNumber ({Clmanal.CODE})<=1299)))) then {Clmanal.TOTalPD}
 
too many brackets...this should work

if tonumber({Clmanal.MONTH})= 1 and
toNumber({Clmanal.CODE}) >= 1200 and
toNumber({Clmanal.CODE}) <= 1299 then {Clmanal.TOTalPD}

Jim Broadbent
 
Or
if tonumber({Clmanal.MONTH})= 1 and
toNumber({Clmanal.CODE}) in 1200 to 1299
then {Clmanal.TOTalPD}
Mike

 
No it didn't work. I still get 00's instead of amounts in database. Any other suggestions?
 
you are repeating your posts....please don't do this

You probably have nulls in your database...either that or you are not showing the WHOLE formula...rather just the part that you think is important.

try this

if not isnull({Clmanal.MONTH} and
not isnull({Clmanal.CODE}) and
tonumber({Clmanal.MONTH})= 1 and
toNumber({Clmanal.CODE}) >= 1200 and
toNumber({Clmanal.CODE}) <= 1299 then
{Clmanal.TOTalPD}
else
0.00; //you should assign an else condition

make sure you do the isnull tests in this order...it is important that they be done first. Jim Broadbent
 
I have another question on a formula selecting dates and if it equal a year to put text in it. I'm trying to create duration of a claims policy. This is not working. Can someone help me?

select Year(CurrentDate)-{Clmincr.CIISSYEAR}
case <=1:
&quot;Duration 1&quot;
case = 2:
&quot;Duration 2&quot;
case = 3:
&quot;Duration 3&quot;
case = 4:
&quot;Duration 4&quot;
case = 5:
&quot;Duration 5&quot;
case = 6:
&quot;Duration 6&quot;
case = 7:
&quot;Duration 7&quot;
case = 8:
&quot;Duration 8&quot;
case = 9:
&quot;Duration 9&quot;
case = 10:
&quot;Duration 10&quot;
case = 11:
&quot;Duration 11&quot;
case = 12:
&quot;Duration 12&quot;

Thank you

Renata
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top