What I'm trying to do is retrieve a derived column which concatenates a numeric field to a text city name. The SQL I'm trying to replicate is:
CAST(code AS varchar(10)) + ' - ' + description AS locdesc
My first pass was:
Expression descriptionEx = new Expression(" - ", ExOp.Add, LocalFields.Description);
Expression concatEx = new Expression(LocalFields.Code, ExOp.Add, descriptionEx);
state.Fields[LocalFields.Description.Name].ExpressionToApply = concatEx;
Which throws an exception (when I fetch) because Code is of type Decimal in the database (SQL Server). No surprise there. But I'm not sure how to do the cast/convert in the expression.
I'm using v2.0.0.0 final.