crystal report formula Search * 'Like' - crystal-reports

{Detail A } Like '%*%'
{Detail A } Like '***'
Can I find it?

AFAIK theres no possibility to check for an asterisk * using the Like operator in Crystal Reports.
But you can user the InStr-function instead:
Instr({#Detail A}, "*") > 0
The InStr-function will return the position of the first occurrence of the character "*" in the Detail A-formula.
Means, if the character is being found, the return value is > 0.

Related

crystal report how to extract the correct value?

My report have an error using below script.
If the field have value will display the value inside, if don't have need to set it as 0, but report show empty value.
If {Invoice.TaxExempted} <> "" then
tonumber({Invoice.TaxExempted})
else
tonumber(0)
Result
if have value 400 : it do display 400.00
but if empty value : it just show empty only, but i wish it display 0.00
Most likely, the field is not blank (""). Instead, it's NULL.
So change the formula to:
if isnull({Invoice.TaxExempted}) Then
0
else
tonumber({Invoice.TaxExempted})

i can't show space in formula in Crystal Report

I use this code to show the sum of my bank
if {?Bank} = {Bank.sum} then {#1} else 0
I have 6 bank accounts and when the bank = Bank has operations, then I show the sumand else I do not show anything.
I do not want to show "0" in my report.
I want to show " "(space), but when I change it to " ".
When I do it, I get the error
A number is required here
How can I fix it?
In that case, use:
if {?Bank} = {Bank.sum} then ToText({#1},0) else ""
The 2nd arg indicates zero decimal points. See online documentation of the ToText() function.
One option:
if {?Bank} = {Bank.sum} then ToText({#1}) else ""
Another option is to use formatting.

Crystal Reports -- How to show after decimal value differentnly in formula

I want to show after decimal 2 value in report but there a condition if value meet that condition then need to show full value. formula is given below but it is giving error
if trim({As400InTemp.PARTYCODE})='006883' then
{As400InTemp.SPPRIC}
else
round({As400InTemp.SPPRIC},2)
you can use MID like this:
"33.09789"
MID({yourstringhere}, 4)
or
MID(CSTR({yourstringhere}), 4)
it will return a value of 09789;

Crystal Reports “the ) is missing”

I'm trying to run a report that has already been created and works. But when I try to run an error pops up with the 'Formula Workshop' screen and it says "the ) is missing". This is the formula displayed:
if({a.sched_firm_qty}+{a.sched_excess_qty} != 0)
then
(({a.actual_firm_qty}+{a.actual_excess_qty}) / ({a.sched_firm_qty}+{a.sched_excess_qty}))-1
else
-1
Please help
Your formula should look like
if(({a.sched_firm_qty}+{a.sched_excess_qty}) <> 0)
then
(({a.actual_firm_qty}+{a.actual_excess_qty}) / ({a.sched_firm_qty}+{a.sched_excess_qty}))-1
else
-1
I've added one additional bracket for first summary and replaced matching operator. <> is equivalent for != in CR. Hope it helps

Formula help needed

I am trying to write a report that is looking for someone that HAS NOT had a certain immunization. The problem is what ever I try for a formula it is saying they have had it or have not had the immunization. When I go to validate it is not always correct
if ({table.column} in (ID#) to (ID#)) then
"Has had Immunization"
else if ({table.column} <> (ID#) to (ID#))
then "Has not had Immunization"
ID# was the same number for all.
Record-selection formula:
// list desired immunization values; remove quotes if IDs are numeric
{table.field} IN [
'ID0',
'ID1',
...
'IDn'
]