We have an AMPscript page using LookupOrderedRows() to create a list of resources ordered by the company name. I noticed that the list begins with a name starting with lowercase "a" then firms with numbers, then upper case "A", etc. Apparently LookupOrderedRows() sorts lower case then numbers then upper case? Am I correct? Is there a way to make the sort order ignore case for creating the rowset?

  • 1
    Are you sure you're not using LookupOrderedRowsCS()? Maybe provide us with a code sample? – Adam Spriggs Jul 29 '14 at 21:47

Unfortunately, you cannot directly do what you are trying to do via LookupOrderedRows(). That being said, there is a reasonably painless workaround, which I have used on multiple occasions. Do all your segmenting using Query Activities on this data extension, putting the results in a new data extension, in just the order you need them. Then you won't need to worry about case sensitivity.

Hope this helps.

  • Do you have a sample of said query, mayhaps? – Kelly J Andrews Aug 1 '14 at 13:25
  • I would do something like SELECT UPPER(column_name1) AS col_name1_UPPER, column_name2 FROM DE_Of_Choice ORDER BY col_name1_UPPER ASC and put that in a staging DE. I'd query that DE to get my data, using the ProperCase AMPscript method to format the data when its returned. – Timothy Aug 1 '14 at 17:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.