||Re: ORDER OF TABLE
Bruce Beacham <bbeacham@no_plm_lowman.co.uk>
||Sat, 23 Mar 2019 08:50:12 +0000
A fine reply!
Something old, something new, something borrowed...
Nothing from IBM, though!
On 22/03/2019 08:52, Mervyn Bick wrote:
> On 2019-03-21 8:55 PM, Mustansir Ghor wrote:
> If you want to present the records in the order natural order of records
> pharmrec you are going to need to provide a field in pharmrec that can
> be used in an ORDER BY clause after the join has been made.
> Execute the following command in the Command Panel to add the field seq
> This requires exclusive use of the table so it will fail if the table is
> in use elsewhere.
> alter table pharmrec add seq int
> If you place the following code in the header section of your report it
> will ensure that the seq field is up-to-date whenever the report is run.
> use pharmrec
> replace all seq with recno()
> This does not require exclusive use of the table so it will work even if
> the table is in use elsewhere.
> Now you can use the following in your report
> select * from pharmrec a join pharm p on a.item=p.code order by seq
> and this should give you the order you want.