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

CONVERT

Status
Not open for further replies.

mgason

Technical User
Feb 6, 2003
158
AU
I am a Crystal newbie,
In Formula workshop Crystal XI can I convert a string coming from a SQL database to a number?
For reasons beyond my control the field must be a string in the SQL database but only contains numbers.
I tried this, and every other sort of term for number I could think of, like Int, Num etc

{fn CONVERT("RecipeIngredients"."Scale",<smallint> )}

no luck.
can CONVERT do this?
If not Is there another way?

thanks
mark
 
Write a formula in crystal:

Tonumber({YourField})

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"If you have a big enough dictionary, just about everything is a word"
--Dave Barry
 
I tried this
Tonumber({"RecipeIngredients"."Scale"})
I get there is an error in this SQL expression?
 
dgillz was suggesting that you could use a Crystal formula, not a SQL expression, to do the conversion. It is true, though, that a SQL expression would be speedier. Try this SQL expression:

{fn convert("RecipeIngredients"."Scale",sql_smallint)}

-LB
 
Thanks,
newbie I am!
I completely failed to understand dgillz meant formula. (or really to realise I was not writing one in the "formula workshop" yes I am that new!)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top