This is SQL code for you original computed column (assuming a string field of 20 characters): CAST(OPRNUM - OPRID AS NVARCHAR(20)) You have two problems there: You're using minus (-) operator, which doesn't really make sense here, because OprId isn't a number. I assume you wanted to concatenate OprNum and OprId with '-' as a separator, but it's not what you code does. OprNum is an int, therefore you have to convert it to string. You want something like this: CAST(CAST(OPRNUM AS nvarchar(5)) + '-' + OPRID AS NVARCHAR(20)) And this is X++ code generating such T-SQL code: return SysComputedColumn::cast(SysComputedColumn::returnField ( tableStr(TestView), identifierStr(ProdRouteTrans), fieldStr(ProdRouteTrans,OprNum) ), 'nvarchar(5)') +"+ '-' + "+ SysComputedColumn::returnField ( tableStr(TestView), identifierStr(ProdRouteTrans), fieldStr(ProdRouteTrans,OprID) );
↧