Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Data Model Questions

sorting by two parameters


Reply

3 Posts   1055 Views

Avatar
Victor

29 March 2009 at 4:52am Community Member, 128 Posts

I want to sort by two parameters like in SQL "... ORDER BY `lastname`,'firstname`" but it seem not to work and I cannot find documentation

Thank you in advance. Victor

Avatar
Hamish

29 March 2009 at 11:06am Community Member, 712 Posts

This should work:

$records = DataObject::get("SomeObject", "","SortFieldA ASC, SortFieldB ASC");

Avatar
Victor

29 March 2009 at 12:03pm (Last edited: 29 March 2009 1:15pm), Community Member, 128 Posts

Yes, I found it. But on my way to find I found a strange error.
Thanks

Victor