SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Jun 2012
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Gettin birthday reminders in vb 2008 and sql server

    Gettin birthday reminders

    Hi,

    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.

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,247
    Mentioned
    59 Post(s)
    Tagged
    3 Thread(s)
    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
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •