Select last week data from current date based on condition in SQL Server

Last Reply 4 months ago By pandeyism

Posted 4 months ago

Hi everyone,

this job will work every Monday at first. He's going to check up last week conditions 

for example

x users - at week 23 - 8 hours of data entered - TotalWatch 40 - 8 - 8 = 24 hours of data if that week coincides with April 23(holiday table).

If x user - also in the 23rd week - no data entered - If that week is equalizing April 23 Total Time 40 - 8 = 32 hours need to enter data.

If x user - also in week 23 - no data entered - that week no holidays, ie Total Time 40 = 40 hours.

I created sample data. Also I shared my code.

I want to make all employees come from the table of employees and efort table that week, if the data entered the total hours come. If the data is not entered that week, total hours 0.

http://sqlfiddle.com/#!9/cf4da7/1

This question does not have replies that have been liked.