- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
/////определяем зарплату по кол-ву учеников
str := 'SELECT C.Salary, C.DateID'+
' FROM CriteriaOfSalaryTeachers C, TeacherStyleGroup TSG, CriteriaOfSalaryTeacherDate CD' +
' WHERE (CD.TeacherStyleGroupID = TSG.TeacherStyleGroupID)'+
' AND (TSG.TeacherStyleID =:tsid) AND (TSG.GroupID =:idg)'+
' AND (CD.DateID = C.DateID) AND (CD.DateTimeActivity <= :da) AND (CD.DateTimeClose > :datt)'+
' AND (C.MinPupils <= :mip) AND (C.MaxPupils > :mipi)';
Salary := MainForm.Query(str, 3, 'float:'+TSID+
'; integer:'+GroupID+
'; datetime:'+DateToStr(MyDate)+' '+TimeToStr(MyTime)+
'; datetime:'+DateToStr(MyDate)+' '+TimeToStr(MyTime)+
'; integer:'+IntToStr(CountPupils)+
'; integer:'+IntToStr(CountPupils));
if Salary[0,0] = '__false__' then
result := -1