'Find Unmatched records in joined table

Let me explain the scenario to you. We have two tables, people and points, which are as follows.

People: Id, FirstName, LastName, Birthday(YYYY-MM-DD)

Points: Id, PersonId, Score, Description

Points table refers to the People table by PersonId foreign key.

Our system automatically scores people on their birthdays, but sometimes there may be a problem and the system may not score. I need the SQL query to be able to identify which people did not score on their birthday.

I wrote the below query to find birthdays but I couldn't find out how to detect people who didn't get scores on their birthdays.

DATEADD(Year, DATEPART(Year, GETDATE()) - DATEPART(Year, BirthDate), BirthDate)
BETWEEN CONVERT(DATE, DATEADD(WEEK, -1, GETDATE())) AND CONVERT(DATE, GETDATE())
sql


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source