How to get latest entries by particular field?
Looks like you're trying to echo out the results using {{ instead of actually setting it using %} tags.

{% set entries = craft.entries.section('works').order('fieldname desc').limit(5) %}

{% for entry in entries %}
   {{ entry.title }}
{% endfor %}


This should fix your problem.