How to get last 7 day's data from current datetime in SQL Server?
<pre><code>SELECT DISTINCT 
    VEEMS_CREATED_DATE
FROM 
    VEEMS_SHIP_STATE_DATA 
WHERE 
    VEEMS_CREATED_DATE &lt;= DATEADD(day,-7, GETDATE())
ORDER BY 
    VEEMS_CREATED_DATE
</code></pre>