Solved

Crystal Reports Formula Error 'A Number is Required Here'

Posted on 2009-04-07
3
3,060 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Ready to get started with anonymous questions?

It's easy! Check out this step-by-step guide for asking an anonymous question on Experts Exchange.

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 …
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

617 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