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

Using memo field in a formula 2

Status
Not open for further replies.

alectek

Programmer
Jul 9, 2003
68
US
Hi!
I need if statement in a formula:
if {@A} = "1" then "Smile" else "Cry".

But {@A} is a memo field from Database I can't touch.
Is there are any ways to convert memo to string or memo to number inside of Crystal.

Thanks a lot.
Al.
 
Use a SQL Expression field, and convert the memo field to a 255 character string. This, of course, is database dependant. Here's an example SQL Expression that would work for SQL Server:
[tt]
convert(varchar(255), Table.MemoField)
[/tt]
You won't see your memo field in the list of available fields in the SQL Expression Editor, but just type it in, and it'll work.

-dave
 
Dave's solution is Crystal version, database and connectivity dependent, none of which you shared in your post.

CR 8.5 and below have this limitation, and some databases or connectivities won't support SQL.

If Dave's solution doesn't work, try posting technical information.

Another means is to use the embedded Crystal syntax within the SQL Expression builder:

{fn Convert(char(254), Customer.`Last Year's Sales`)}

Here's the whitepaper:


-k
 
Thank you Dave and Synapsevampire's. Your solutions helped me very much.

Thanks again.
Al
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top