str_ = "SELECT LZK.*, Zakaz.*, Gurn_LZK.*, Naimen.* " & _
"FROM Naimen INNER JOIN (((Zakaz INNER JOIN Izd ON Zakaz.Kod_Zak = Izd.Zakaz) INNER JOIN Gurn_LZK ON Izd.Kod_Izd = Gurn_LZK.Izd) INNER JOIN LZK ON Gurn_LZK.Kod_LZK_plan = LZK.Izd) ON Naimen.Kod_N = LZK.Naimen " & _
"WHERE ((((Gurn_LZK.Data) <=#" & Format(Ar(0), "mm\/dd\/yyyy") & "#) And ((Gurn_LZK.Aktiv) = True) And ((Round([LZK].[Kol_vo] - [LZK].[Kol_vo_Otg], 2)) > 0)) Or (((Gurn_LZK.Data) >= #" & Format(Ar(0), "mm\/dd\/yyyy") & "# And (Gurn_LZK.Data) <= #" & Format(Ar(1), "mm\/dd\/yyyy") & "#) And ((Round([LZK].[Kol_vo] - [LZK].[Kol_vo_Otg], 2)) > 0))) and zakaz.plant=" & Forms!Global!Plant & " and gurn_lzk.kod_lzk_plan=" & lz!Kod_LZK_plan
|