[SOLVED] Remodeling a number to a string with characters an numbers? lazarus / 16-Databases ---------------------------------------------------------------------- madref · 2016-09-17 22:27 In one of my qeuries/views i have a number that represent a billing number. But i want to transform this billing number to a reference number that contains characters and numbers. Billing number -=> Reference Number 1 -=> AFA-000001 231 -=> AFA-000231 1234 -=> AFA-001234 etc, etc Is this possible in SQLite? ---------------------------------------------------------------------- valdir.marcos · 2016-09-18 01:46 This command works on Firebird: Code: SQL  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i SELECT 1, 'AFA-' || RIGHT('000000' || '1',6), 231,'AFA-' || RIGHT('000000' || '231',6), 1234,'AFA-' || RIGHT('000000' || '1234',6) FROM rdb$database; ---------------------------------------------------------------------- madref · 2016-09-18 06:24 Nope this does not work But this does Code: SQL  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i 'AFA-' || Adm_Faktuurnummer Now only the fixed length ---------------------------------------------------------------------- madref · 2016-09-18 09:26 Found it... Code: SQL  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i 'AFA-' || SUBSTR ("000000" || Adm_Faktuurnummer, -6, 6)