Solved

Crystal Reports Formula Error 'A Number is Required Here'

Posted on 2009-04-07
3
2,853 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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 …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

706 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now