Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Need a crystal formula Post Reply Post New Topic
Author Message
avishalpatil
Newbie
Newbie


Joined: 24 Dec 2010
Online Status: Offline
Posts: 13
Quote avishalpatil Replybullet Topic: Need a crystal formula
    Posted: 25 Mar 2011 at 12:53am
Hi All ,

I have a string like this "12._Services_62" in a database.

I want all the left hand side string before the second "_" sign.

Please help me.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 25 Mar 2011 at 4:11am
local numbervar uScore := instr({table.field},"_");
uScore := instr(uScore + 1, {table.field},"_");
 
if uScore = 0 then
  {table.field}   //only 1 underscore
else
  Left({table.field},uScore-1)
IP IP Logged
avishalpatil
Newbie
Newbie


Joined: 24 Dec 2010
Online Status: Offline
Posts: 13
Quote avishalpatil Replybullet Posted: 27 Mar 2011 at 9:27pm
Hey Thank You So Much....
It works!!!
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.