Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Embedded Field formating in text formula 2

Status
Not open for further replies.

Reynet01

Technical User
Apr 27, 2004
59
US
I have a field called jobnumber that shows up as a long number such as 75412.00 I would like it to only show 75412 how do I format the number if it is embedded in a text formula. Below is the formula

if {Dictations.state}=14 then "At Transcriptionist" & "/" & " "&{Dictations.JobNumber}else
if {Dictations.state}=10 then "Dictated" & "/" &" "& {Dictations.JobNumber}else
if {Dictations.state}=15 then "Awaiting QA" & "/" &" "& {Dictations.JobNumber}else
if {Dictations.state}=16 then "At QA" & "/" &" "& {Dictations.JobNumber}else
if {Dictations.state}=6 then "Pending" & "/" &" "& {Dictations.JobNumber}else
if {Dictations.state}=12 then "To Send" & "/" &" "& {Dictations.JobNumber}else
if {Dictations.state}=17 then "Pre-Transcribed" & "/" &" "& {Dictations.JobNumber}else
if {Dictations.state}=22 then "Signed-Off" & "/" &" "& {Dictations.JobNumber}else
"Unknown " & "/" &" "& {Dictations.JobNumber}

If knowledge were power I would be a AAA battery!
 
Wrap the JobNumber field in the ToText function:

ToText({Dictations.JobNumber}, 0, "")

-dave
 
Thanks that worked great

If knowledge were power I would be a AAA battery!
 
Just to make the formula a little more readable and somewhat more efficient, consider using Local Variables and getting rid of some unnecessary concatenation.
eg

Code:
Local StringVar job := ToText( {Dictations.JobNumber},0,"" ) ;
Local NumberVar state := {Dictations.state} ;

if state = 14 then "At Transcriptionist/ " & job 
else if state = 10 then "Dictated/ " & job 
else if state = 15 then "Awaiting QA/ " & job 
else if state = 16 then "At QA/ " & job 
else if state = 6  then "Pending/ " & job 
else if state = 12 then "To Send/ " & job 
else if state = 17 then "Pre-Transcribed/ " & job 
else if state = 22 then "Signed-Off/ " & job 
else "Unknown / " & job




Bob Suruncle
 
Thanks that is much cleaner than my mess
Rob

If knowledge were power I would be a AAA battery!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top