select top 12 order ascending

2013-09-23 Thread James Harvey
Here is how I get the last 12 horses sold to appear in a grid in order by hip number ascending. Hip_no is a character field, but they want it to show as a number, with no leading zeros. The amount field gets an amount posted as each horse is sold at the auction. Is it possible to get the return

Re: select top 12 order ascending

2013-09-23 Thread MB Software Solutions, LLC
select b1.* from (select top 12 val(hip_no) as MyValue, hip_no as MyKey from stnhorse where Amount 0 order by 1 desc) a1 inner join stnhorse b1 on a1.MyKey = b1.hip_no order by a1.MyValue ASC into cursor MyResult Just a WAG, but basically I'm having the subselect do the criteria selecting,