title: SQL Query Sorting
body: <p>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.</p>
  
  <p>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;</p>
  
  <pre><code>SELECT
    user_name,
    created_date
  FROM DATABASENAME.dbo.tbl_user
  WHERE user_name LIKE 'guest-%'
  </code></pre>
  
  <p>A line of the resulting output (once in the csv) looks like;</p>
  
  <pre><code>guest-12343,2016-09-20 19:57:50.347
  </code></pre>
  
  <p>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?</p>