Hello all,
I'm definitely not a Crystal expert, so any help that can be provided would be greatly appreciated.
I need to sort a report based on the string data that I have extracted from a Description (string) field.
Example of the type of data stored in this string field {brptGLFinDet;1.DetailDesc}=
Invoice/20/920000/ZENITH TECH INC/ 8373003311/83733- /JB App
I am extracting the job# (83733-).
The job# will be located in a different place in the field depending on the type of transaction it is. This is the reason for the IF statement for the Jrnl {brptGLFinDet;1.Jrnl}. Ie, AP entries show the Job# between the 7th & 8th delimiter ("/"), AR trans show the Job# between the 5th & 6th delimiter.
I had success extracting the job# onto the report design using the formula:
local numbervar Start := instr({brptGLFinDet;1.DetailDesc},"/");
if
Start > 0 then
if {brptGLFinDet;1.Jrnl} = "AP" then split({brptGLFinDet;1.DetailDesc},"/")[7] else
if {brptGLFinDet;1.Jrnl} in[ "AR", "JB", "BL"] then split({brptGLFinDet;1.DetailDesc},"/")[6] else
if {brptGLFinDet;1.Jrnl} = "ER" then split({brptGLFinDet;1.DetailDesc},"/")[5]
else
"Undefined job"
However, I can't use this formula as a sort.
I'm not very good with variables, but I'm thinking that the use of variables may be the solution. (??)
Thanks in advance for any help!