Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Formula to look at a certain digit in text Post Reply Post New Topic
Author Message
Beso90
Groupie
Groupie
Avatar

Joined: 12 Jun 2014
Location: United States
Online Status: Offline
Posts: 48
Quote Beso90 Replybullet Topic: Formula to look at a certain digit in text
    Posted: 17 Apr 2018 at 5:19am
Hello,

I'm building location labels and would like a formula to place an arrow pointing up or down based on the second segment of the location number.


locations are formatted like: A5-01-01
the second segment of that text defies the rack level, they are 01, 02, or 03.

I want it something along these lines:
if second segment is 01 then down else up



Thank you,
Bas
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 18 Apr 2018 at 5:51am
If the location will always be formatted with "-" between the sections, try something like this:

NumberVar at = inStr({MyTable.Location}, '-');
if at > 0 then
if mid({MyTable.Location}, at + 1, 2) = '01' then
    chr(226)
else chr(225)


When you put this formula on your report, change the font to WingDings and you'll get the appropriate up or down arrow.

-Dell
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.