Q:

Case statement to find 90 days between two columns

I have two different table and I'm trying to create a case where if the 'A date' is between 90 days from the 'rollment date'. 
First table
  Member ID       rollment date
       1           11/1/2014
       2           4/1/2015
       3           1/1/2014
       4           2/1/2014
       5           6/1/2014

Second Table
       Member ID    A        A date
           1       Yes     12/5/2014
           2       Yes     6/9/2015
           3       Yes     6/5/2014
           4       Null     Null
           5       Yes     7/25/2014

I want my output to look like this:
   Member ID    Enrollment      Within 90 days
    1             11/1/2014           Yes
    2             4/1/2015            Yes
    3             1/1/2014            No
    4             2/1/2014            No
    5             6/1/2014            Yes

My sql query looks like this:
       SELECT  
        a.MemberID
       ,a.rollment
       ,Case when B.A date between a.rollment < '90' then 
       'yes' else 'no' end      

   FROM [Database].[dbo].[Test] a   
   left join [database].[dbo].[Test2] b on a.MemberID = B.MemberID

Would someone help me.

A:

You should use datediff, like this:
SELECT  
    a.MemberID
   ,a.rollment
   ,Case when datediff(day, B.[A date], a.rollment) < 90 
         then 'yes' else 'no' end
FROM 
   [Database].[dbo].[Test] a   
   left join [database].[dbo].[Test2] b 
       on a.MemberID = B.MemberID

