SQL - Get data for yesterday and day before

sql

Solution

MEMBER BETWEEN (GETDATE() -2) AND (GETDATE() -1)

In SQL Server you can also try:

MEMBER BETWEEN DATEADD(day, -2, GETDATE()) AND DATEADD(day, -1, GETDATE())

Problem

I am running this query: ``` select member, customerinfo.customerid -- ...other irrelevant columns... from customerinfo, addressinfo where customerinfo.customerid = addressinfo.customerid and MEMBER = (Date(GetDate()-1)) and addressinfo.addresstype = 's' ``` I it is obviously giving me data if Member = yesterday. My question is, how do I structure the query to give me data if Member = the last 2 days (yesterday and the day before)?

Original source