I'm trying to create a column in a view in SQL server 2008. The column is to be generated from two fields in the table, date and an account number, in the format dd.mm.yyyynnnnnnnn where nnnnnnnn is the account number. I've prototyped it in Access and it works fine, but I can't get it to work here in SQL server. I've tried the following;
SELECT charGroup, charAccID, intAccountNo, charType, charBankCode, charCurr, dteDate, charAsAt, monAmount, charTLACode, charChequeNo, charStatus, charDescription,
CONVERT(VARCHAR(50), dteDate, 104) AS VARCHAR + intAccountNo AS GENKEY
FROM dbo.tblStatementHold
Any ideas?