Answers.Body: <p>You're so close it's maddening—you should be able to order by a custom field as well:</p>
  
  <pre><code>{% set assets = craft.assets.find({sourceId: 2, order: 'date desc'}) %}
  </code></pre>
  
  <p>Where <code>date</code> is the name of your custom field.</p>
  
  <p>From the <a href="http://buildwithcraft.com/docs/templating/craft.assets#order">Craft docs</a> (emphasis added):</p>
  
  <blockquote>
    <p>Possible values include 'title', 'id', 'sourceId', 'folderId', 'filename', 'kind', 'width', 'height', 'size', 'dateCreated', and 'dateUpdated', <strong>as well as any textual custom field handles</strong>.</p>
  </blockquote>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-14T17:44:45.780Z
Answers.Text: Thank you. I was so close. It works perfectly. I've also noted your edits on my post for future questions.
Answers.UserDisplayName: Niall Thompson
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-14T17:46:32.213Z
Answers.Text: @NiallThompson Your question was excellent and thorough, I just did some tidying. I hope you don't mind :)
Answers.UserDisplayName: Matt Stein
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-14T17:31:17.083Z
Answers.LastActivityDate: 2014-07-14T17:37:22.663Z
Answers.LastEditDate: 2014-07-14T17:37:22.663Z
Answers.UserDisplayName: Matt Stein
Body: <p>I have a page which lists assets by source. I've added a date field to the asset.</p>
  
  <p>How can I order the assets by this field so that the most recent is first?</p>
  
  <p><img src="https://i.sstatic.net/doYWd.png" alt="asset date field"></p>
  
  <p>Here is my markup:</p>
  
  <pre><code>{% set assets = craft.assets.find({sourceId: 2}) %}
  
  {% for asset in assets %}
      &lt;a href="{{ asset.url }}"&gt;{{ asset.date | date('M Y') }}&lt;/a&gt;
  {% endfor %}
  </code></pre>
  
  <p>Looking at the <a href="http://straightupcraft.com/cheat-sheets" rel="nofollow noreferrer">cheat sheet for Assets</a> it seems that these are my only options for order:      <code>title</code>, <code>id</code>, <code>sourceId</code>, <code>folderId</code>, <code>filename</code>, <code>kind</code>, <code>width</code>, <code>height</code>, <code>size desc</code>'.</p>
  
  <p>Ideally I could do something like this:</p>
  
  <pre><code>{% set assets = craft.assets.find({sourceId: 2, order: '{{ asset.date }}'}) %}
  </code></pre>
  
Tags: <assets><date><ordering>
Title: Order Assets by date field
ThreadText: # Order Assets by date field
  
  (Asked by: username_0 on 2014-07-14)
  
  I have a page which lists assets by source. I've added a date field to the asset.
  
  How can I order the assets by this field so that the most recent is first?
  
  ![asset date field](https://i.sstatic.net/doYWd.png)
  
  Here is my markup:
  
  ```
  {% set assets = craft.assets.find({sourceId: 2}) %}
  
  {% for asset in assets %}
      <a href="{{ asset.url }}">{{ asset.date | date('M Y') }}</a>
  {% endfor %}
  
  ```
  
  Looking at the [cheat sheet for Assets](http://straightupcraft.com/cheat-sheets) it seems that these are my only options for order: `title`, `id`, `sourceId`, `folderId`, `filename`, `kind`, `width`, `height`, `size desc`'.
  
  Ideally I could do something like this:
  
  ```
  {% set assets = craft.assets.find({sourceId: 2, order: '{{ asset.date }}'}) %}
  
  ```
  
  **Tags:** assets, date, ordering
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2014-07-14. Score: 7 | Accepted answer
  
  You're so close it's maddening—you should be able to order by a custom field as well:
  
  ```
  {% set assets = craft.assets.find({sourceId: 2, order: 'date desc'}) %}
  
  ```
  
  Where `date` is the name of your custom field.
  
  From the [Craft docs](http://buildwithcraft.com/docs/templating/craft.assets#order) (emphasis added):
  
  > Possible values include 'title', 'id', 'sourceId', 'folderId', 'filename', 'kind', 'width', 'height', 'size', 'dateCreated', and 'dateUpdated', **as well as any textual custom field handles**.
  
  > **Comments:**
  > **username_0**: Thank you. I was so close. It works perfectly. I've also noted your edits on my post for future questions.  
  > **username_1**: @username_0 Your question was excellent and thorough, I just did some tidying. I hope you don't mind :)  
  
  ---
  
  