- Код: Выделить всё
rsrptDet.Open "SELECT DISTINCT sprDept.DeptID, sprDept.DeptName, sprDept.DeptDirectorName, " _
& "LZKDetail.NumberPP AS numberPP, LZKDetail.Date, LZKDetail.NaimDocOpl, " _
& "LZKDetail.VidLpatStr, LZKDetail.SummOpl, LZKDetail.idLZK, LZK.LimitMoneyMonth " _
& "FROM sprDept, LZKDetail, LZK " _
& "WHERE sprDept.DeptID=LZK.IDDept AND LZKDetail.idLZK=LZK.id AND " _
& "LZKDetail.Date BETWEEN " & d1 & " AND " & d2 & " AND LZK.Date BETWEEN " & d1 & " AND " & d2 & " ORDER BY idLZK", conn