cancel
Showing results for 
Search instead for 
Did you mean: 

Formula Error

Former Member
0 Kudos

I am trying to run a formula as follows:

'*' & {Table.Field} & '*'

The idea being that I get the result: (where the field is '123')

*123*

However, every time I run this report, I get the result:

*123.00*

The decimal places are appearing for no apparent reason, the field has no decimal places.

I have tried to fix this with no result, it is confusing me very much.

Can someone help me?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Did you try ToText?

'*' & ToText({Table.Field},0) & '*'

Former Member
0 Kudos

I've tried :

'*' & ToText({Table.Field}) & '*'

which didn't work.

If I try:

'*' & ToText({Table.Field},0) & '*'

It gives an error: "Too many arguments have been given to this function"

Former Member
0 Kudos

ToText is very specific about the data types being passed into it, and the error you mention occurs when a string value is passed. So what type is the field you are trying to manipulate?

This is ugly but may get closer to a solution, wrap ToNumber into the ToText just for fun.

'*' & ToText(ToNumber({Table.Field}),0) & '*'

Answers (4)

Answers (4)

Former Member
0 Kudos

This worked:

'*' & ToText(ToNumber({Table.Field}),0) & '*'

The field i am passing to the report is and integer, from a mysql database.

Thanks everyone.

I needed this to suit certain types of scanners we have, they only scan numbers between the two '*'.

Former Member
0 Kudos

Hi

Are you very specific that you need a formula itself in this case.

My suggestion is to put two stars in a text field and place the value you want to display in between them , also you can format this value in your desired format too.

Hope this helps

Regards

Vivek

0 Kudos

Please try the following:

'*' + ToText({Table.Field},0) + '*'

With kind regards,

Pieter Jong

Crystal Advice
http://www.crystaladvice.com

former_member188030
Active Contributor
0 Kudos

Hi,

More information required.

- Version of crystal Reports

- Version of Visual Studio.

- win or web app

- Does the report work from CR designer.

If the issue is from CR design, please post the query in the Crystal Reports design forum.

- Bhushan.

Former Member
0 Kudos

Sorry, Information below.

Crystal Reports is the latest version, biuld version 13.0.2

Visual Studion Ultimate 2010

Windows forms application

By CR designer, do you mean in Visual Studio? In which case no.