I have the below piece of code which displays all the data i need for the next step however i am struggling a bit. I need SQL to work out the days (excluding weekends) between T0.[U_IIS_DDDT] to T0.[U_AVL_offered], T0.[U_IIS_DDT] to T0.[U_AVL_offered] and finally T0.[U_IIS_DDDT] to T0.U_iis_plan . I then need it to work out the average days it takes to book in the appointment. Basically its so our clients can see how efficient we are at booking/completing works. Is this something that is feasible to do in SQL? Thanks in advance for the help
SELECT T0.[callID],T2.[Name], T0.[U_iis_job], T1.[Name], T0.[createDate], T0.[U_IIS_DDDT], T0.[U_AVL_offered], T0.U_iis_plan, T0.[U_AVL_NA1], T0.[closeDate] FROM OSCL T0 INNER JOIN OSCP T1 ON T0.problemTyp = T1.prblmTypID INNER JOIN OSCS T2 ON T0.status = T2.statusID WHERE T0.[createDate] >= '[%0]' and T0.[createDate] <= '[%1]'