Thank you all,<br> it works.<br><br><b><i>Matt Lawrence &lt;matt.lawrence@ymogen.net&gt;</i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> Will Smith wrote:<br>&gt; Hi, I know this is not the room for DBIx, I tried to post in DBIx, but<br>&gt; did not go through, so, if you don't mind, please do not bounce me out.<br>&gt; my question is:<br>&gt; I have a multiple join, and trying to sort the dataset using oder_by,<br>&gt; and get either error, or do not sort.<br>&gt; my code is:<br>&gt;     # table: calls,property,city . property has many calls, city has<br>&gt; many property,   calls belong to property, property belong to city<br>&gt;     my $rs = [$c-&gt;model('myappDB::City')-&gt;search(<br>&gt;     {<br>&gt;       'calls.CallerID' =&gt; '1',<br>&gt;       'calls.CallStatusID' =&gt; '0'<br>&gt;     },<br>&gt;     {<br>&gt;        order_by =&gt; 'city.CityName'<br>&gt;     },<br>&gt;    
 {<br>&gt;       join =&gt; { 'property' =&gt; 'calls'<br>&gt;                }<br>&gt;     }<br>&gt;     )];<br>&gt;<br>&gt; How can I sort by CityName ?<br>&gt;<br>&gt; Thank you.<br>Looks like you have too many hashrefs there, and the city table is<br>called "me" because it's the main table you're searching in.<br><br>Try it like this:<br><br>    my $rs = [$c-&gt;model('myappDB::City')-&gt;search(<br>    {<br>      'calls.CallerID' =&gt; '1',<br>      'calls.CallStatusID' =&gt; '0'<br>    },<br>    {<br>       order_by =&gt; 'me.CityName',<br>      join =&gt; { 'property' =&gt; 'calls' },<br>    }<br>    )];<br><br><br><br>Matt<br><br>_______________________________________________<br>List: Catalyst@lists.rawmode.org<br>Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst<br>Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/<br>Dev site: http://dev.catalyst.perl.org/<br></blockquote><br><p>&#32;
      <hr size=1>Be a better Heartthrob. <a href="http://us.rd.yahoo.com/evt=48255/*http://answers.yahoo.com/dir/_ylc=X3oDMTI5MGx2aThyBF9TAzIxMTU1MDAzNTIEX3MDMzk2NTQ1MTAzBHNlYwNCQUJwaWxsYXJfTklfMzYwBHNsawNQcm9kdWN0X3F1ZXN0aW9uX3BhZ2U-?link=list&sid=396545433">Get better relationship answers </a>from someone who knows.<br>Yahoo! Answers - Check it out.