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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error in formula

Status
Not open for further replies.

Madawc

Programmer
Sep 5, 2002
7,628
GB
Better done in a formual field:
Code:
if udfgenid=53 
then if isnull(udfnum)) or udfnum=0 
        then 1
        else 0
else 0
If that does not work, try displaying the original values in a diagnostic detail line.

You could also try changing the zero values to 2 and 3, as a diagnostic, just to see where the logic is going

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
I have tried but not working. I am getting error value. Any other workaround
 
Please show the formula as you implemented it and the exact error message you received.

-LB
 
I hav eimplemented formula like this:

if {udfnum.un_udfgen_id}=53

then if isnull({udfnum.un_number}) or {udfnum.un_number}=0

then 1
else 0
else 8080;


I am getting result of 8080 for all the records irrespective whether 53 holds 0, 1 or null.
CRT is attached
 
 http://www.mediafire.com/?zl3d6ee9h1la9wa
Do a new formula that just says
Code:
{udfnum.un_udfgen_id}=53
Put it on the report, it should show True or False.

My guess is that it will show False: the value might be alpha or fractional.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
I have entered the formula however I am getting the result of the formula against 53 is true.
 
what does this do with your data?

if {udfnum.un_udfgen_id} <> 53
then 8080
else
(if isnull({udfnum.un_number}) or {udfnum.un_number}=0
then 1
else 0 );
 
the formula i posted should do the same as your original. i changed the criteria to alter the order things occur.
only those with the value of 53 will be evaluated by the 2nd If-Then.

 
This is working in the detail section where udf gen id and udf number are placed , i want to get the result at group footer level. If i am placing the same at group footer i am not getting the result
 
what sort of result in the group footer are you looking for?

if you place the formula i posted in the group footer, i think it will evaluate based only on the last record of the group.
 
in the details section i have the following fields
details
_____________________________________________________________
badge number - time stamp - udf genid- udf number
6528 07/08/2001 1630 53 0
6528 07/09/2001 830 54 1
6528 07/10/2001 1630 54 1
____________________________________________________________
the data was grouped in to 3 groups
____________________________________________________________
1. Timestamp where i got maximum and minimum time, calculated wages etc.
_____________________________________________________________

2.Badge Number: Wher i calculated number of days present/absent per badge
_____________________________________________________________
3.Company wise
_____________________________________________________________

IF i place UGen ID and UD number in gr1/ 2 total values are not being displayed , so i kept them in the details section where all the details pertaining to the badge are displayed.

My formula is if udf gen=53 of a particular badge and udf number =0 then crystal should display its value as 1 otherwise as zero at group footer 2. Basis this I am calculating another formula.
Hope the above is clear.
RPT is already attached.

 
It sounds like you will want a new formula to evaluate the previous formula for each badge number group, and if the SUM is greater than 0, display a 1 otherwise display a 0, correct?.

I do not have crystal in front of me, so apologize for any syntax/errors.

//{@sumbybadge} //put in badge number group footer section
IF SUM({@53and0},{table.BadgeNumber}) > 0
then 0
else 1


//{53and0} //put in details section
if {udfnum.un_udfgen_id} <> 53
then 8080
else
(if isnull({udfnum.un_number}) or {udfnum.un_number}=0
then 1
else 0 );


I do not have crystal in front of me, so apologize for any syntax/errors.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top