A
A
AlexCruel2021-05-28 12:30:28
1C
AlexCruel, 2021-05-28 12:30:28

Is there an "AND" operator in 1C?

It is necessary to find the nomenclature through a 1C request - so that the article and category of the nomenclature are the same as in the request. The "OR" operator is not suitable, but it is. What about the "and" operator? Nothing happens.

ВЫБРАТЬ
  Номенклатура.КатегорияНоменклатуры КАК КатегорияНоменклатуры,
  Номенклатура.Артикул КАК Артикул
ИЗ
  Справочник.Номенклатура КАК Номенклатура
ГДЕ
  Артикул = "2341612"
  И
  КатегорияНоменклатуры = "категория1"

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
AlexCruel, 2021-05-28
@AlexCruel

The problem was in Nomenclature.CategoryNomenclature.NAME

ВЫБРАТЬ
  Номенклатура.КатегорияНоменклатуры КАК КатегорияНоменклатуры,
  Номенклатура.Артикул КАК Артикул
ИЗ
  Справочник.Номенклатура КАК Номенклатура
ГДЕ
  Номенклатура.Артикул = "23416"
  И Номенклатура.КатегорияНоменклатуры.Наименование = "категория1"

A
Anton Anton, 2021-05-28
@Fragster

With the operator And everything is fine. But "nothing happens" and "an empty query result is returned" are different things.
Most likely the CategoryNomenclature is not a string but a ReferenceReference. The easiest way is to pass it as a parameter: CategoryItems = &CategoryItems , Query.SetParameter() and that's it. In some cases, it is possible through two points: CategoryNomenclature.Description = "category1"

K
Konstantin, 2021-05-28
@fosihas

Query language 1C:Enterprise 8 (digital version)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question