• I wrote a moving explanation and it wandered off into the ether, the general idea was this: Swap your between statement around. The code I used, slightly altered from yours is below.

    if object_id('tempdb..#person')is not null drop table #person

    if object_id('tempdb..#totemp')is not null drop table #totemp

    create table #person

    (personid int identity(1,1) not null,

    firstname varchar(50) not null,

    lastname varchar(50) not null,

    dob smalldatetime not null)

    insert into #person values('Lino','Dorotheos','2009-03-27 00:00:00.000')

    insert into #person values('Apostolos','Maria','2009-03-28 00:00:00.000')

    insert into #person values('Filippos','Dimitris','2009-03-28 00:00:00.000')

    insert into #person values('Sotirios','Anastasios','2009-03-29 00:00:00.000')

    insert into #person values('Yiannis','Theophylaktos','2009-03-29 00:00:00.000')

    insert into #person values('Kyriakos','Angelos','2009-03-30 00:00:00.000')

    insert into #person values('Yorgos','Xoán','2009-03-30 00:00:00.000')

    insert into #person values('Nicolau','Kyriakos','2009-03-31 00:00:00.000')

    insert into #person values('Xurxo','Tryphon','2009-04-07 00:00:00.000')

    insert into #person values('Emmanouil','Spiridon','2009-04-25 00:00:00.000')

    create table #totemp(dob smalldatetime null)

    insert into #totemp values('2009-03-27 00:00:00.000')

    insert into #totemp values('2009-03-28 00:00:00.000')

    insert into #totemp values('2009-03-28 00:00:00.000')

    insert into #totemp values('2009-03-29 00:00:00.000')

    insert into #totemp values('2009-03-29 00:00:00.000')

    insert into #totemp values('2009-03-30 00:00:00.000')

    insert into #totemp values('2009-03-30 00:00:00.000')

    insert into #totemp values('2009-03-31 00:00:00.000')

    insert into #totemp values('2009-04-07 00:00:00.000')

    insert into #totemp values('2009-04-25 00:00:00.000')

    declare @c_Month_of_birth INT

    declare @c_Date_of_birth INT

    set @c_Month_of_birth=datepart(mm,dateadd(dd,15,getdate()))--advanced month

    set @c_Date_of_birth=datepart(dd,dateadd(dd,15,getdate()))--advanced Date

    --select @Month_of_birth,@Date_of_birth

    SELECT P.PersonID, P.FIRSTNAME ,P.LASTNAME ,P.DOB

    from Person AS P

    where

    datepart(d,DOB) <@c_Date_of_birth

    AND

    datepart(mm,DOB) BETWEEN datepart(mm,getdate()) AND @c_Month_of_birth