Trending Data Back for Previous Days

Hi all,

Hoping someone can help me - I have a simple SQL query that pulls a count of customers for the current date, although I want to trend that back for, let’s say arbitrarily, 2 years. How would I go about this?

SELECT 

CAST(CURRENT_DATE() AS TIMESTAMP) AS Date, 

COUNT(DISTINCT CustomerId) AS CustomerCount 

FROM table

WHERE CURRENT_DATE() >= DATE(CustomerAdded)

Thanks!

0 0 55
0 REPLIES 0
Top Labels in this Space
Top Solution Authors