Produce fixed length output to file regardless of the length of data in each column/row
The select below will add the spaces required for each field.  The date format is fixed to 10 characters.  The "|" sign is was added to show that the size of each coloum is fixed.  Can be removed if not needed.

SELECT LEFT(AccountCode + SPACE(20) , 20) +
'|' + LEFT(AccountName + SPACE(50) , 50)  +
'|' + LEFT((CAST(Account_Id AS NVarchar(10)) +
SPACE(10)), 10) + '|'+  
FORMAT(LastPayDate , 'yyyy-MM-dd')
FROM [Accounts]