Wednesday, 28 August 2013

SQL - Get data for yesterday and day before

SQL - Get data for yesterday and day before

I am running this query:
select member, customerinfo.customerid, ContactName, Address1, Address2,
City, State, ZIP, Country 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)?

No comments:

Post a Comment