Topic Options
#26629 - 03/21/11 12:59 PM Formulas
Reen Offline
Adagio Groupie

Registered: 01/13/11
Posts: 16
Loc: Saskatchewan, Canada
I am fairly new at using Crystal Reports with Adagio and have been trying to create a formula that when the field has a "zero" qty it will return a - (dash)instead of a 0 otherwise it returns the value but have been unsuccessful. This is the formula I tried ...

IF {ICW65 Items.Qty on sales order} = 0 THEN "-" ELSE {ICW65 Items.Qty on sales order}

Can anyone tell me what I am doing wrong.

Thanks,

Top
#26630 - 03/21/11 01:10 PM Re: Formulas [Re: Reen]
Reen Offline
Adagio Groupie

Registered: 01/13/11
Posts: 16
Loc: Saskatchewan, Canada
Also I do not want to just surpress the zeros.

Top
#26631 - 03/21/11 01:38 PM Re: Formulas [Re: Reen]
Softrak Support Offline

Adagio Action Team

Registered: 03/09/99
Posts: 11532
Loc: Vancouver, BC Canada
Hi Reen,

Crystal Reports wants both the 'True' and 'False' results to have the same data type. In your example, the 'True' result is a character, but the 'False' result is a number. This is an error as far as Crystal Reports is concerned.

There is a way to do this without even having to create a formula field. Assuming you have the 'Qty on Sales Order' field already in your report, right-click on it and pick 'Format Field' from the pop-up menu. From the Number tab, click the Customize button below all the pre-defined number formats.

On this 'Custom style' screen at the bottom right side, there is a selection for 'Show zero values as', and a dash is one of the available choices. Pick this and click OK to save it. Now when you print the report, zeroes are replaced by dashes.
_________________________
Regards,
Softrak Tech Support

Top
#26632 - 03/21/11 01:52 PM Re: Formulas [Re: Softrak Support]
Reen Offline
Adagio Groupie

Registered: 01/13/11
Posts: 16
Loc: Saskatchewan, Canada
Thank you. I had been through the format field section but missed the setting for zeros.

Much appreciated.

Top


Moderator:  Softrak Support 
Who's Online
1 registered (AudreyQuick), 62 Guests and 0 Spiders online.
Key: Admin, Global Mod, Mod
Forum Stats
1865 Members
5 Forums
14458 Topics
70634 Posts

Max Online: 432 @ 01/20/25 10:17 PM
April
Su M Tu W Th F Sa
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30