I've got a question, where I'm struggeling with at the moment. I really don't know how to solve this problem, it seems so simple.
I've got a Customer ID, and an Order Date. I only want to show customer, that ordered things before 2015 AND buyed something lets say in the last 10 days.
I created a little test table for that - lets say it's January 2016:
Now there is Customer 1, that did a purchase on January and in year 2010. Ok that fits my need, I want to show him. But customer 2 did a purchase on December last year, so he is a not a "returning" customer, but a customer that often buys my things. I dont want to show him.
I tryed something like this, but it didn't work:
SELECT [Kunden_ID],Bestellung
FROM [Immo].[dbo].[TEST] AS A
WHERE (Bestellung >=DATEADD (day,-10,getdate())
AND Bestellung <= DATEADD (month,-12,getdate()))