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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help parsing out field info

Status
Not open for further replies.
Oct 11, 2002
28
0
0
US
I've got an ODBC connection to an SQL database. What I'm trying to do is use an SQL Expression to make a field that pulls as 12345678901 show 12345-6789-01 in the report. I'm not very familiar with the string functions within Crystal. Any help is appreciated.
 
You could just use a regular formula:

picture({table.string},"xxxxx-xxxx-xx")

-LB
 
If you wanted to actually split the field, rather than just display it, the basic Crystal functions are LEFT, RIGHT and MID, which work by length. SPLIT works by a particular value.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
The Picture formula threw errors. We're on Crystal 8.5, if that makes a difference.

This version handles Left and Right just fine, but doesn't recognize Mid.

Devin
 
It should work in 8.5, so please post your exact formula and also report the exact error message you received. Can you verify that the field is a string to begin with?

-LB

 
Nevermind. I figured out my problem. I was in SQL Expressions, rather than Formulas. Formulas gave me what I needed.

Picture does work in the Formulas.

Thanks, though.

Devin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top