I am at the very beginnings of my IT and Database experience, fortunately landed an IT Coordinator job. I am tasked with the responsibility of pulling contacts to run through our text manager service. I’ll need to run birthdays according to the current date. Pull the list from the Contacts table which should contain all the necessary info needed. Full Name, DOB, and Mobile number. Using SQL Server.
Not entirely sure how the query would look, wondering how you guys would run this. I figured it would go along the lines of selecting those columns from the table in regard to today’s(or whenever it is run) date. Those that have birthdays today would get a birthday text sent out to them.
Would this be a viable query? I know this could be entirely wrong. Any criticism and help is much appreciated! Thank you in advance.
SELECT FullName, DOB, MobileNum FROM Contacts where datepart(d, DOB) = datepart(d, getdate()) and datepart(m, DOB) = datepart(m, getdate())