SELECT
NULL GenelBilgiler,
(CASE WHEN sd.EntryDate IS NULL THEN (Format(sd.ValueDate, N’MMddyy’)) ELSE sd.EntryDate + Format(sd.ValueDate, N’yy’) END) EntryDate,
sd.ValueDate,
ra.BankAccountsId,
ra.SWIFTCode,
ra.AccountNumber,
ra.AccountSuffix,
LEFT(c.CustomerName,100) CustomerName,
f.FecCode,
FORMAT((CONVERT(VARCHAR(50),(CASE WHEN DebitCreditCode IN (‘D’,‘RC’) THEN sd.Amount ELSE 0 END) )),‘N2’,‘tr-tr’) StatementDebit,
(CASE WHEN DebitCreditCode IN (‘C’,‘RD’) THEN sd.Amount ELSE 0 END) StatementCredit,
0.00 AccountingDebit,
0.00 AccountingCredit,
sd.AccountsReference + ’ ’ + sd.InstitutionsReference + ’ ’ + sd.SupplementaryDetails SharedReferanceDetails,
sd.InformationToAccountOwner,
sd.IdentificationCode,
NULL AccSystemDate,
NULL AccUserName,
NULL ResourceName,
NULL BusinessKey
FROM BOA.RCC.BankAccounts ra WITH (NOLOCK)
JOIN BOA.CUS.Customer c WITH (NOLOCK) ON c.Customerid=ra.AccountNumber
JOIN BOA.COR.FEC f WITH (NOLOCK) ON f.FecId=ra.FEC
JOIN BOA.RCC.SwiftDebit sd WITH (NOLOCK) ON sd.BankAccountsId=ra.BankAccountsId AND sd.Status=‘U’
WHERE ra.BankAccountsId = 21–(SELECT BankAccountsId FROM #BankAccounts WHERE Id = @Incrementer) AND f.FecGroup IN (0,1) AND ra.IsActive = 1 . Argument data type varchar is invalid for argument 1 of format function hatasını düzeltip tekrar yazar mısın