Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: formula with return number and string Post Reply Post New Topic
Author Message
huyenhall
Newbie
Newbie
Avatar

Joined: 07 Apr 2008
Online Status: Offline
Posts: 7
Quote huyenhall Replybullet Topic: formula with return number and string
    Posted: 08 Apr 2008 at 10:05am

I have this formula:

If {sort_codes} = "HX03" then {Building_sf}
else
If {sort_codes} = "A001" then {Street_name}
 
It was giving me an error "a number is expected" .
 
Can anyone help me to write this formula that returns both numbers and string?
 
Thanks,
 
IP IP Logged
saoco77
Senior Member
Senior Member


Joined: 26 Jun 2007
Online Status: Offline
Posts: 104
Quote saoco77 Replybullet Posted: 08 Apr 2008 at 10:33am
Don't think you can do that within Crystal.

Listed below are the options to convert one of the two fields to a string or numeric value.

totext({table.field})

tonumber({table.field})

It's likely you'll have to convert the number to a string. Tonumber is generally used when you have a numeric field stored as text.

Hope this helps.

Sarah
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.