Gettin birthday reminders
I am building a database for an institution. However, I will love the database to intimate the operator of birthdays of those in the database using vb 2008 and sql server. My query for the sql server goes thus:
select Surname, Other_Names, Mobile_Phone from Parishioner_Adults where WHERE day(Date_of_Birth) =day((GETDATE()+15)) AND month(Date_of_Birth)=month(getdate())
But I am not getting any result when it is called. Please can anyone give me a suggestion please.
first, you have two WHEREs in a row, that'll give a syntax error, and if you're not seeing the syntax error, then your error detection code in vb is faulty
second, let's look at the requirements...
why are you simply adding 15 to GETDATE()? does that even work?
i think you should be using the DATEADD function
This topic is now archived. It is frozen and cannot be changed in any way.