Na ekranie elementów ZZ utworzyłem dodatkowa kolumnę po której chciałbym filtrować . Jest to kolumna z wartością atrybutu pozycji .
Kod: Zaznacz cały
select Atr_Wartosc as 'Status' from cdn.ZamElem , cdn.Atrybuty where
ZaE_GIDTyp = Atr_ObiTyp and ZaE_GIDNumer = Atr_ObiNumer and ZaE_GIDLp = Atr_ObiLp
and Atr_AtkId = 9 and {filtrSQL}
Kod: Zaznacz cały
@PAR ?@R(SELECT ID =1, Kod = 'Otwarta' UNION SELECT ID=2, Kod = 'Zamknięta')|StatusPozycji|&StatusPozycji: @? PAR@
ZaE_GIDNumer in (
select Atr_Obinumer from cdn.ZamElem , cdn.Atrybuty where
ZaE_GIDTyp = Atr_ObiTyp and ZaE_GIDNumer = Atr_ObiNumer and ZaE_GIDLp = Atr_ObiLp
and Atr_AtkId = 9 and Atr_Wartosc = ??_Q_RES2_StatusPozycji
)