1 Reply Latest reply on Jun 6, 2006 2:20 PM by MikerRoo

    Order By clause is ignoring LowerCase field name

    SUJIT_G
      I am trying to use a QoQ, but am running into a problem when using the order by clause...

      All the fieldvalues in the order by field start with uppercase except for one, and this field name gets thrown to the end of the list

      Anyone got any ideas???

      thanks

      Sujit
        • 1. Re: Order By clause is ignoring LowerCase field name
          MikerRoo Level 1
          Before you try the following, please note that you can clean this up in your original DB queries -- which is almost always better.

          Anyway, suppose your QofQ was:
          SELECT MixcasedColumn
          FROM SomeQuerySet
          ORDER BY MixcasedColumn

          Then you would add a dummy column to use for case-insensitive sort:
          SELECT
          MixcasedColumn, UPPER (MixcasedColumn) AS SortColumn
          FROM
          SomeQuerySet
          ORDER BY
          SortColumn <!--- Note that upper() is not allowed here but derived columns are! --->