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!

IF/Else within the Formula Editor STILL being ignored

Status
Not open for further replies.

ZanX

Programmer
Aug 29, 2001
9
US
This is the code:

{sa_bale_class.sale_no} = {?sale_no_in} and
{sa_bale_class.current_division_no} <> 35 and
{sa_bale_class.current_division_no} <> 38 and
if {?drop-no-in} > 0 then
{sa_bale_class.sale_drop_no} = {?drop-no-in}
Else
{sa_bale_class.sale_drop_no}>0


Crystal is being CALLED from ASP page (this code is not inside the ASP). I have tried Crystal syntax...but that is not an issue here. I have tried () everywhere. Thanks for the previous replies...any help send this WAY!!!
 
I agree with both of you. Here is my problem: I am an intern, and the 0 is the way the company has been doing it (though it is not working). I am going to suggest the &quot;All&quot;, b/c I think it makes more sense as well. Also, the crystal program was developed(and is already) by someone else, so I lack the complete knowledge of what is going on. I do think that I still should be able to understand this part. MY BIG QUESTION: Why is the formula editor not reading the IF statement. It is just flat out ignoring it. If it could handle the IF, then I would not have any problems with my first formula...right? Inform me to what you know about how an IF is treated within, b/c we are all still using IF statements...
Ngolem: I understand what you are doing, but I do not know how to go in to the &quot;already developed&quot; program to change things, and I think this is the other problem currently. I surely appreciate all of the info. I have recieved. Nobody here wants to work with Crystal, so they just dumped it on me! LOL. =)

 
Hi;

I went over your formula again and see now that I confused {?drop-no-in} and {?sale_no_in}.
I guess in my rush they all seemed alike. I have redone the formulas and I think this should work.


Formula: Select - sale_drop_no

*************************** Start here ****************

BeforeReadingRecords;
numberVar upperRange;
numberVar lowerRange;

if not numerictext({?-no-in}) then
(lowerRange := 0;
upperRange := 9999999;)
else
(lowerRange := tonumber({?drop-no-in});
upperRange := tonumber({?drop-no-in});)

*************************** end here ****************

This is based on using a string like &quot;ALL&quot; for selecting all numbers...actually the way it is written any string will generate an ALL result.
Place this, Select - sale_drop_no , in the first Report Header Section and suppress the section


NOW Replace your entire record selcetion formula with the following Record Select Formula:

*************************** Start here ****************

numberVar upperRange;
numberVar lowerRange;

{sa_bale_class.sale_no} = {?sale_no_in} and
{sa_bale_class.current_division_no} <> 35 and
{sa_bale_class.current_division_no} <> 38 and
{sa_bale_class.sale_drop_no} in lowerRange to upperRange;

*************************** end here ****************

This should work now

Sorry about confusing your parameters

Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top