Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

# Crytal if formula

Posted on 2013-01-02
Medium Priority
308 Views
I need help with a formula that show true if the price ends with a 0 or 5 and False if not.

Thanks!!!!
0
Question by:evend
[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

Accepted Solution

FLProfessional earned 668 total points
ID: 38738726
it's a little dirty, but this should work:

local stringvar checkprice:=ToText(table.price, 2);

If { MID(checkprice,len(checkprice),1) = "0" or MID(checkprice,len(checkprice),1) = "5"} Then
//put whatever you want here, it's true
Else
// it's false
End If
0

LVL 101

Assisted Solution

mlmcc earned 668 total points
ID: 38738910
Does price have decimals?  If so the formula above should work but it would be easier with RIGHT instead of MID

``````local stringvar checkprice:=ToText(table.price, 2);

If { Right(checkprice,1) = "0" or MID(checkprice,1) = "5"} Then
//put whatever you want here, it's true
Else
// it's false
End If
``````

If prices are in dollars (no cents then)

``````local stringvar checkprice:=ToText(table.price, 0);

If { Right(checkprice,1) = "0" or MID(checkprice,1) = "5"} Then
//put whatever you want here, it's true
Else
// it's false
End If
``````

mlmcc
0

LVL 35

Assisted Solution

James0628 earned 664 total points
ID: 38739304
Converting the price to a string, as in the posts above, is the most flexible solution.  Then you can check for any digits you want.

But since you're specifically looking for 0 and 5, Mod is another option.

If your field is an integer:

({price field} Mod 5) = 0

If your field has 2 decimal places and you want to check the last decimal place:

(({price field} * 100) Mod 5) = 0

James
0

Author Comment

ID: 38883125
I've requested that this question be deleted for the following reason:

A friend helped me with.
0

LVL 101

Expert Comment

ID: 38872251

Did you try any of them?

If so what was the result?

mlmcc
0

LVL 101

Expert Comment

ID: 38883126
You need to address the comments from the experts before deleting this question.

The comments provided are viable solutions which should be accepted as such

mlmcc
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
###### Suggested Courses
Course of the Month11 days, 16 hours left to enroll