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!

Crystal Reports 10 Need Formula

Status
Not open for further replies.

mcole22

Technical User
Apr 27, 2007
6
US
I need a formula like below, just not sure what to put after the else.

if {IMRECHST_SQL.qty_received} is <=0 then 0 else (in this I want the actual amount received {IMRECHST_SQL.qty_received}

What I am getting in the received qty is, if the qty was received it is showing -450 and if it hasn't been received it is showing 450 and I want this latter part to show 0.

I tried it like this - if {IMRECHST_SQL.qty_received}<= 0 then 0 else {IMRECHST_SQL.qty_received}. But it came up with this error - The formula result must be a boolean
 
Where are you placing this formula (the obvious question)???

Posting thesoftare used,database and connectivity always helpsaswell.

if {IMRECHST_SQL.qty_received} is <=0 then
0
else
IMRECHST_SQL.qty_received}

Place this as a conventional formula and it will work in lieu of your received field(Detailssection).

-k
 
When I put this formula in it gives me an error saying the keyword "then" is missing. I am using Progessive Explorer database and Crystal Reports 10
 
Make sure you are using "Crystal Syntax" and take out the 'is'...

if {IMRECHST_SQL.qty_received} <=0 then
0
else
IMRECHST_SQL.qty_received}
 
The application you are using Progression Explorer, there is no such thing as Progressive Explorer.

I happen to make my living with this particular product.

The database is either Pervasive/Btrieve or MS SQL.

I also need to know - like in the original post - where this formula is located. How did you create it?

If you are going to report, selection formulas (as I suspect) this is the wrong place to do this.

You need to create a new formula field. Do you know how to do that?



Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"If you have a big enough dictionary, just about everything is a word"
--Dave Barry
 
I am working with Progression Series 7.6.400 SQL
I created a new report field in alerts not in report select
also using CRYSTAL SYNTAX

this is how I put it in.

if {IMRECHST_SQL.qty_received}is >= 0 then 0 else
{IMRECHST_SQL.qty_received} Got error keyword then is missing and then I also tried it without the (is) and got error formula result must be a boolean.

I do not understand what I am doing wrong???
 
Hi,
If this is actually intended to be a Report Alert then the condition MUST result in TRUE or FALSE ( a boolean)...

If just a regular formula, it does not belong in an Alert but in the report body somewhere ( like in the details)..

In which case it would be:
@ThisFormula
Code:
if {IMRECHST_SQL.qty_received} >= 0 
then 
0 
else 
{IMRECHST_SQL.qty_received}





[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Get rid of the word "is".

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"If you have a big enough dictionary, just about everything is a word"
--Dave Barry
 
Sorry I just re-read your post. If you are making a report alert the yes this must be a boolean, that is to say it must evaluate to true or false.

Your formula evaluates to 1 or 0.

If you want this formula to show on your report somewhere, you should be creating a new formula field, not creating an alert.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"If you have a big enough dictionary, just about everything is a word"
--Dave Barry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top