====== pears.NetReportVacShiftsCountOfHoursIncSiteLines ====== Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace. ===== Original SQL ===== create procedure "pears"."NetReportVacShiftsCountOfHoursIncSiteLines"( in "pWebUserID" char(20),in "pVacancyID" char(20),in "pShiftDate" char(15) ) result( "Shift_Date__R" date,"Shift_Times__R" char(50),"Break_Time__R" char(20),"State__R" char(1),"Candidate__R" char(50),"Total_Hours__R" decimal(10,2) ) begin select "TempShift"."ShiftDate" as "Shift_Date", "string"("dateformat"("TempShift"."TimeFrom",'hh:nn'),' - ',"dateformat"("TempShift"."TimeTo",'hh:nn')) as "Shift_Times", "TempShift"."BreakMinutes", "TempShift"."State", "String"("Temp"."Surname",', ',"GetWord"("Temp"."Forenames",1)) as "Candidate", "getshiftlength"("TempShift"."TimeFrom","TempShift"."TimeTo","isnull"("TempShift"."BreakMinutes",0)) as "Total_Hours" from "Vacancy" key join "TempShift" key join "Person" as "Temp" ,"vacancy" key join("employment" key join("company","person")) ,"vacancy" join "status" on "vacancy"."status" = "status"."status" and "status"."type" = 'V' where "TempShift"."State" in( 'P','B','W' ) and "Vacancy"."VacancyID" = "pVacancyID" and "ShiftDate" = "pShiftDate" order by "Tempshift"."TimeFrom" asc,"Candidate" asc end go COMMENT TO PRESERVE FORMAT ON PROCEDURE "pears"."NetReportVacShiftsCountOfHoursIncSiteLines" IS {create procedure pears."NetReportVacShiftsCountOfHoursIncSiteLines"( in "pWebUserID" char(20),in "pVacancyID" char(20),in "pShiftDate" char(15) ) result( "Shift_Date__R" date,"Shift_Times__R" char(50),"Break_Time__R" char(20),"State__R" char(1),"Candidate__R" char(50),"Total_Hours__R" decimal(10,2) ) begin select "TempShift"."ShiftDate" as "Shift_Date", "string"("dateformat"("TempShift"."TimeFrom",'hh:nn'),' - ',"dateformat"("TempShift"."TimeTo",'hh:nn')) as "Shift_Times", "TempShift"."BreakMinutes", "TempShift"."State", "String"("Temp"."Surname",', ',"GetWord"("Temp"."Forenames",1)) as "Candidate", "getshiftlength"("TempShift"."TimeFrom","TempShift"."TimeTo","isnull"("TempShift"."BreakMinutes",0)) as "Total_Hours" from "Vacancy" key join "TempShift" key join "Person" as "Temp" ,"vacancy" key join("employment" key join("company","person")) ,"vacancy" join "status" on "vacancy"."status" = "status"."status" and "status"."type" = 'V' where "TempShift"."State" in( 'P','B','W' ) and "Vacancy"."VacancyID" = "pVacancyID" and "ShiftDate" = "pShiftDate" order by "Tempshift"."TimeFrom" asc,"Candidate" asc end }