I have a table which I want to run a query against to pull out data to a csv file. The data needs to be sorted by username and I only want output of people created within the last seven days.
So far I can pull out the data that I need, but can't quite figure how to achieve the piece surrounding only the last seven days. My query looks like this at present;
SELECT
user_name,
created_date
FROM DATABASENAME.dbo.tbl_user
WHERE user_name LIKE 'guest-%'
A line of the resulting output (once in the csv) looks like;
guest-12343,2016-09-20 19:57:50.347
Can anyone recommend how I might be able to adapt the statement to be more selective on with the data in the created_date column?
todayandtoday - 6 days.