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!

Error ' A number is required here'??

Status
Not open for further replies.

112055

Programmer
May 13, 2002
61
US
I am saving a bunch of reports which were originally created on Crystal 6.0, now saving it in Crystal 9.0
This report I am trying to save in Crystal 9.0 has an error message saying ' a number is required here' , what to do?


many thanks
 
It sounds like you have a bad formula. The error should be opening the code where the problem lies at the time of the error.

Post the formula and someone will resolve it for you.

-k
 
Probably you are referencing a function that is no longer supported....there is always an alternative...Post the formula

Jim Broadbent
 


if(uppercase({D.FR})="B" and uppercase({D.CR})="Y") then
CommAmt := {FEE_ON_DEAL.FEE_AMOUNT}*{@FULL_Package_COMM_RATE};

it highlighted

{FEE_ON_DEAL.FEE_AMOUNT}*{@FULL_Package_COMM_RATE};

and the error message ' A number is required here.'

I read some where that his implies that the report has formula that was using Boolean field. Since Boolean fields are used as integers in Enterprise edition, I should change True to -1 and False to 0 respectively.

But where is this boolean they are talking about? not in my code.

I've tried use toNumber infront of that line ..


toNumber{FEE_ON_DEAL.FEE_AMOUNT}*{@FULL_Package_COMM_RATE};
, still no go here ..is the syntax correct?

thanks.
 
Thanks fellas ..I solved it ..sounds crazy ..it took ToNumber to wrap around the highlighted line ..it is crazy but it works for me ..no more errors.
 
You will be back....if this was the problem then the Crystal 6 report would have had the same error...assuming it worked in the first place.

You are implying by this solution that these fields

{FEE_ON_DEAL.FEE_AMOUNT} and {@FULL_Package_COMM_RATE}

have changed datatype in the database...which I suppose could happen but then you better check out the rest of the report ......and check out the database to see what datatype they really are....I imagine if things have changed (which I doubt frankly) You are in for grief on any report using these fields

You can also quickly check this in Crystal by looking at some of the data while in the formula editor.


Jim Broadbent
 
Hi Guys
I had the same problem. I converted a report from CR8.5 to CR9. The report has worked perfectly in CR8.5 for months. When i converted it and ran in web browser i got a "a number is required here error" I had to put ToNumber() arround Summary fields in the formulae. The Sum should be returning a number i would think!. I am now getting a "Date is required here error" in another formulae. This formulae is extracting the day portion of a datetime field and converting it to a string. Report works in CR9 designer OK.
Just when you get used to all the CR quirks, they screw it up again.
Tks
BarryS
 
It has to do with the way Crystal Reports interprets boolean values. Check the datatype of the field your working with. I never saw this with 4.5,5, or 6. I first encountered this same error converting5.0 reports to 8.0. I believe it has to do with the way crystal (or more likely ODBC) handles boolean data types. Since there are so many different variants depending on your dbms, this sort of jacks up crystal. In the old days you could evaluate a boolean as either a number OR a boolean. Now it's a little stricter, there's a difference between {Incident.OSHARec} = TRUE and {Incident.OSHARec} = 1 (obviously asuming {Incident.OSHARec} is boolean). I was really hoping this would be fixed in 9.5, but no...
 
I figured out why i was getting the a "Date is required here error". I was using the Day function on a DateTime field. Once i converted the DateTime field to Date using the DateValue function it worked. It looks like CR9 does more strict type checking as this was not a problem with CR8.5
Still can't understand why Sum({numeric field}) does not return a number and you have to do a ToNumber(Sum({Numeric Field}))!!
BarryS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top