Wednesday, July 02, 2008

CAML sorting by file name

If you are doing a CAML query and want the results sorted by the file name (and not by title, which may be different than the file name) use the following:
<OrderBy><FieldRef Name='LinkFilenameNoMenu' /></OrderBy>

2 comments:

  1. Anonymous8:30 AM

    For the "order by" people need to realize that they have to put it outside of the "where" statements. I fall into the trap many times by adding it inside and nothing works.

    ReplyDelete
  2. Great tip....You save me! Thanks a lot!

    :)

    ReplyDelete

Do not use comments to ask me questions. Want to ask me something, use the contact form