How do I use multiple sort criteria in cfdirectory list?

73 views Asked by At

I know that cfdirectory has a tag for sort, and if I have sort="DateLastModified DESC", it works. If I have sort="Name DESC", it works. But if I have sort="DateLastModified DESC, Name DESC", it doesn't do the second sort. I've tried both using a comma and a pipe to separate, neither works.

<cfdirectory 
    action="List" 
    directory="#docRoot#" 
    type="file" 
    Recurse="Yes" 
    sort="DateLastModified DESC, Name DESC" 
    name="FileQ" > 
<cfdump var="#FileQ#">
1

There are 1 answers

0
Todd K On BEST ANSWER

We recopied the files with correct dates, so the issue resolved itself. However, I think Bernhard Dobler may have hit the nail on the head, it is most likely that the DateLastModified was not completely identical (off by milliseconds)