V
V
Vadim Yagofarov2020-07-10 17:53:12
1C
Vadim Yagofarov, 2020-07-10 17:53:12

How to add 3 columns to 1 in a query in 1s?

There are 3 columns (see the screenshot) and it is necessary that their values ​​are formed as strings i.e. to end up with a line like 711 in a separate column. Now I have the following query, but it writes only the first value to a separate column

ВЫБРАТЬ
  ВопросыШаблонаАнкеты.Ссылка КАК Ссылка,
  ВопросыШаблонаАнкеты.JSON КАК JSON
ИЗ
  Справочник.ВопросыШаблонаАнкеты КАК ВопросыШаблонаАнкеты,
  РегистрСведений.ФормированиеЧПУ КАК ФормированиеЧПУ
ГДЕ
  ВопросыШаблонаАнкеты.ТипВопроса = ЗНАЧЕНИЕ(Перечисление.ТипыВопросовШаблонаАнкеты.Табличный)
  И ВопросыШаблонаАнкеты.Владелец.Ссылка В
      (ВЫБРАТЬ
        ФормированиеЧПУ.ШаблоныАнкет
      ИЗ
        РегистрСведений.ФормированиеЧПУ КАК ФормированиеЧПУ
      ГДЕ
        ФормированиеЧПУ.URL = &URL)

ОБЪЕДИНИТЬ ВСЕ

ВЫБРАТЬ
  ВопросыШаблонаАнкеты.Ссылка,
  ВопросыШаблонаАнкеты.ЭлементарныйВопрос.JSON
ИЗ
  Справочник.ВопросыШаблонаАнкеты КАК ВопросыШаблонаАнкеты,
  РегистрСведений.ФормированиеЧПУ КАК ФормированиеЧПУ
ГДЕ
  ВопросыШаблонаАнкеты.ТипВопроса <> ЗНАЧЕНИЕ(Перечисление.ТипыВопросовШаблонаАнкеты.Табличный)
  И ВопросыШаблонаАнкеты.Владелец.Ссылка В
      (ВЫБРАТЬ
        ФормированиеЧПУ.ШаблоныАнкет
      ИЗ
        РегистрСведений.ФормированиеЧПУ КАК ФормированиеЧПУ
      ГДЕ
        ФормированиеЧПУ.URL = &URL)

I also tried EXPRESSING (Questions of the Questionnaire Template. Parent. Code + "." + Questions of the Questionnaire Template. Parent. Parent. Code + "." + Questions of the Questionnaire Template. Code AS a String) but also failed ((. How to add 3 columns in a query in 1s 1? And where in the current request do I have an error?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Kinash, 2020-07-11
@GIRUPC

Vadim Yagofarov , 1C query language does not support string concatenation. If you need sorting, then just sort sequentially on your three columns. You can do the concatenation itself when you receive data from the request.
But if you really, really need it, then at your own peril and risk:
https://infostart.ru/public/200275/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question