Subject Re: [IBO] Calculated SQLField: Conversion Error from String
Author Helen Borrie
At 02:52 PM 8/08/2012, you wrote:
>Trying to create a sql result that, when painted in html, generates an email link. Would you please show me what is wrong. Using the following query:
>
>select '<a href="mailto:' + r.email + '">' + r.ResLast +'</a>' as ResLast
>from Residents r where kRes = 26
>
>================
>
>This returns the correct table data, but generates the following error:
>
>ISC ERROR CODE:335544334
>
>ISC ERROR MESSAGE:
>conversion error from string "jwcane@..."
>
>STATEMENT:
> frmSQL.crEdit(TIB_Cursor)
>
>================
>
>The email address is correct.
>
>What is wrong with the syntax for adding the email address, and how can I avoid the conversion error?

The "+" symbol is an arithmetic operator in SQL. Use the double-pipe "||" (that's two pipe symbols) which the string concatenator.

Helen





>------------------------------------
>
>___________________________________________________________________________
>IB Objects - direct, complete, custom connectivity to Firebird or InterBase
> without the need for BDE, ODBC or any other layer.
>___________________________________________________________________________
>http://www.ibobjects.com - your IBO community resource for Tech Info papers,
>keyword-searchable FAQ, community code contributions and more ! Yahoo! Groups Links
>
>
>