Solved

Crystal Reports Formula Error 'A Number is Required Here'

Posted on 2009-04-07
3
2,900 Views
Last Modified: 2012-05-06
Hi, I'm trying to construct a very simple formula in Crystal Reports that will only display the value if it is greater than zero. This is the formula I have: -
If {Client.Units} <> 0 then {Clients.Units} else ""
I get 'A number is required here' error.
Have tried this too: -
If {Clients.Units} = 0 then "" else {Clients.Units}
For this I get a 'String is Required Here' error!
I'm sure this is very simple to resolve but I'm relatively new to Crystal and any help would be greatly appreciated.
Thanks in advance.
0
Comment
Question by:bdoshuk
3 Comments
 
LVL 77

Accepted Solution

by:
peter57r earned 250 total points
ID: 24087463
The outputs from an if..then..else.. must be the same datatype - all strings, all numbers, all dates or whatever.

In this case you do not need a formula field at all.
You right-click the Units field and choose Format Field.
You can then check the Suppress when zero option which you will find on the Customize button of the Number tab.
0
 
LVL 10

Expert Comment

by:dougvarga
ID: 24087474
Becuase {Clients.Units} is a number, the "else" clause must also return a number.

If you are trying to suppress this field if zero, you should use a number format instead.

Place the {Clients.Units} on the report, right click and select Format Field
Click on the number tab and then customize button.

put a Check in suppress if zero.

0
 

Author Closing Comment

by:bdoshuk
ID: 31567507
Many thanks!
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question