I've just found an interesting function: INSTR().
It fixed my problem, I'm using this code now:
SELECT SUBSTRING(TESTSQL."Tenant_Suite_Budget"."GL_account_key",1,INSTR (TESTSQL."Tenant_Suite_Budget"."GL_account_key",':')- 1), SUBSTRING(TESTSQL."Tenant_Suite_Budget"."GL_account_key",INSTR...