• Ok, use left (..., 15) only. Copy the below code and try it again.

    selectreplace (replace (left (replace (replace (convert (varchar, getdate(), 120), '', ''), ':', ''), 15), '-', ''), ' ', '') + '.txt'