Question: I am doing my project in MVC4 using c# and sql.. I have a table `MemberDetails` which contain table 

```
CREATE TABLE [dbo].[MemberDetails] (
[Id]          INT           IDENTITY (1, 1) NOT NULL,
[Mem_FirstNA] VARCHAR (100) NOT NULL,
[Mem_LastNA]  VARCHAR (100) NOT NULL,
[Mem_Occ]     VARCHAR (100) NOT NULL,
[Mem_DOB]     DATETIME      NOT NULL,
[Mem_Email]   VARCHAR (50)  NOT NULL,
PRIMARY KEY CLUSTERED ([Id] ASC)
 );

```

I just want to select the names and date of birth where whose birthday in next 30 days and I use the following query 

```
SELECT 
    Mem_FirstNA, Mem_LastNA, Mem_DOB 
FROM 
    MemberDetails 
WHERE 
    Mem_DOB >= getdate() - 1 AND Mem_DOB <= getdate() + 30

```

Is that correct, I got 0 item selected , I use the following table.

```
 1  Pal Software    08-03-1987 AM 12:00:00
 3  mn  Par Bussiness   19-10-1967 AM 12:00:00
 4  man George  Business    13-11-1956 AM 12:00:00
 5  Smi Kan Housewife   22-10-1980 AM 12:00:00

```

Answer: 
try this 

```
        SELECT 
           Mem_FirstNA, Mem_LastNA, Mem_DOB
        FROM 
             MemberDetails 
       WHERE DAYOFYEAR(Mem_DOB)-DAYOFYEAR(getdate())<=30

```
Try this

```
SELECT 
    Mem_FirstNA, Mem_LastNA, Mem_DOB 
FROM 
    MemberDetails 
WHERE 
    WHERE DATEPART(mm,Mem_DOB) BETWEEN DATEPART(mm,getDate()) AND DATEPART(mm,getDate())+1;

```