I have a SQL Database that is back end to a program we use for accounting and business mgt. Inside the program, we can write multiple alerts based on query's of the data stored in SQL. The current query i have written displays an alert when someone has a birthday.
set transaction isolation level read uncommitted
AlertMessage = 'Happy Birthday '+firstname+' '+lastname+' !!'
WHERE DATEPART(d, birthdate) <= DATEPART(d, GETDATE())
AND DATEPART(m, birthdate) = DATEPART(m, GETDATE())
I would like to modify it so that it shows the alert 30 days before the birthday is going to happen.