I am trying to fix an existing query that does not return all the people that it should. I think I have found the problem but by removing the part of the WHERE CLAUSE statement that is keeping the query from returning all the people it causes it to return multiple rows of the same person. I have...
I am trying to take multiple rows of a person and their time worked and turn it into one line with their total time worked for a given date range. At this point I am able to get the different clock in and out times for the day and turn that into HoursWorked for the day but I need to add those...
Here is my latest attempt at it but it is still not right.
SELECT Records.Employee, Records.HoursWorked, Records.TimeDate
FROM (SELECT employee_account_name AS Employee, CONVERT(varchar(10), start_date_time, 101) AS TimeDate, SUM(TimePeriod)...
Working to modify the query so it will add all the HoursWorked for a person together on one line for a given date range instead of listing each instance of a person and their time for each day on multiple lines so I can select the person to be shown if the total HoursWorked for a week are less...
I am trying to modify an existing query to show when a person has 0 hours worked. I need all the records listed in the Exc Table and only the HoursWorked Field from the Records Table when there is a matching record in the Exc Table, if there is not a record that matches the record in the Exc...
Thank you very much Golom. I was tring Case statements and that wasn't working out for me and I did not know that I could wright a statement like:
AND NOT (TABLE2.CONTACT IS NULL AND TABLE2.TERM_DATE IS NULL)
Hi, I am trying to SELECT records from 2 tables. I want to get records WHERE TABLE2_TERM_DATE is NULL unless the TABLE2_CONTACT field is NOT NULL. If the TABLE2_CONTACT is NULL and TABLE2_TERM_DATE is Null then I don't want those records. Below is the code I have so far, any help would be...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.