How to make space on Lookup in Form

I am looking for this solutions for few months, but I did not succeeded - please help.

So, when I make
Data Type: Select
Lookup Method: Automatic

and I have something like that:
SELECT idDoc, sc_concat(idDoc, Name)
FROM Doc
ORDER BY idDokumentiMape, OznakaMape

I get result like: 645NameOfIt

but I want to get nice look, like: 645 NameOfIt

I want space between two fields. How to achieve that?

Thank you for your help!

Hello @mitja ,

Looks like a MySQL query, so try this:


SELECT idDoc, concat(idDoc, ' ', Name) as id_with_name
FROM Doc
ORDER BY idDokumentiMape, OznakaMape

Oracle way:


SELECT idDoc, (idDoc || ' ' || Name) as id_with_name
FROM Doc
ORDER BY idDokumentiMape, OznakaMape

Notice that I am using native concat function from db. I do not know why SC reinvent the wheel.

Partly correct except that you should use the sc macros. So it would be:

SELECT idDoc, sc_concat(idDoc, ’ ', Name)
FROM Doc
ORDER BY idDokumentiMape, OznakaMape