I dont want to fuss about the select * in this query... But something else... Its a new and improved way to sort data...
Check this out:
<FONT color=#0000ff size=2>SELECT </FONT><FONT color=#ff0000 size=2>* </FONT>
<FONT color=#0000ff size=2>FROM XXX </FONT>
<FONT color=#0000ff size=2>ORDER BY </FONT><FONT size=2>TO_CHAR</FONT><FONT color=#ff0000 size=2>( (</FONT>
<FONT size=2>TO_DATE</FONT><FONT color=#ff0000 size=2>(</FONT><FONT size=2>DATUM</FONT><FONT color=#ff0000 size=2>,</FONT><FONT color=#008080 size=2>''</FONT><FONT size=2>dd</FONT><FONT color=#ff0000 size=2>.</FONT><FONT size=2>mm</FONT><FONT color=#ff0000 size=2>.</FONT><FONT size=2>yyyy</FONT><FONT color=#008080 size=2>''</FONT><FONT color=#ff0000 size=2>)),</FONT><FONT color=#008080 size=2>''</FONT><FONT size=2>yyyy</FONT><FONT color=#008080 size=2>''</FONT><FONT color=#ff0000 size=2>)</FONT><FONT color=#008080 size=2>'</FONT></FONT><FONT color=#008080 size=2>
||'</FONT><FONT color=#ff0000 size=2>||</FONT><FONT size=2>TO_CHAR</FONT><FONT color=#ff0000 size=2>( (</FONT><FONT size=2>TO_DATE</FONT><FONT color=#ff0000 size=2>(</FONT><FONT size=2>DATUM</FONT><FONT color=#ff0000 size=2>,</FONT><FONT color=#008080 size=2>''</FONT><FONT size=2>dd</FONT><FONT color=#ff0000 size=2>.</FONT><FONT size=2>mm</FONT><FONT color=#ff0000 size=2>.</FONT><FONT size=2>yyyy</FONT><FONT color=#008080 size=2>''</FONT><FONT color=#ff0000 size=2>)),</FONT><FONT color=#008080 size=2>''</FONT><FONT size=2>mm</FONT><FONT color=#008080 size=2>''</FONT><FONT color=#ff0000 size=2>)</FONT><FONT color=#008080 size=2>'
||'</FONT><FONT color=#ff0000 size=2>||</FONT><FONT size=2>TO_CHAR</FONT><FONT color=#ff0000 size=2>( (</FONT><FONT size=2>TO_DATE</FONT><FONT color=#ff0000 size=2>(</FONT><FONT size=2>DATUM</FONT><FONT color=#ff0000 size=2>,</FONT><FONT color=#008080 size=2>''</FONT><FONT size=2>dd</FONT><FONT color=#ff0000 size=2>.</FONT><FONT size=2>mm</FONT><FONT color=#ff0000 size=2>.</FONT><FONT size=2>yyyy</FONT><FONT color=#008080 size=2>''</FONT><FONT color=#ff0000 size=2>)),</FONT><FONT color=#008080 size=2>''</FONT><FONT size=2>dd</FONT><FONT color=#008080 size=2>''</FONT><FONT color=#ff0000 size=2>) </FONT><FONT color=#800080 size=2>DESC</FONT>
<FONT color=#800080 size=2></FONT>
<FONT color=#800080 size=2>P.s.: DATUM is a string field...</FONT><FONT color=#008080 size=2>
</FONT>