I would do something like this:
select invoice table
set order to 0
use in select('curAux')
select (fieldlist) from (invoices table) into cursor curAux readwrite
nofilter where (dates of invoicing period)
update curAux set (invoice number field) = padl(alltrim(invoice number
field),5)
select * from curAux into cursor curInvoices readwrite nofilter order by
(invoice number field)
And print your invoices using curInvoices, not your original invoice table.
I do this all the time, especially if the invoice number is a character
type and somehow my restriction routine at the time of saving the
invoice number does not do something like this:
cInvNbr = padl(alltrim(cInvNbr),5) && to order the numbers correctly,
always to the right
insert into invoice table( invnbr,*****) values(cInvNbr,****) && list of
fields to insert
Using the selects above, you do not need to use the index, which in your
case is obviously producing the wrong results. And you do not need to
worry about whether you use Windows XP or Vista or W7, or whether the
invoice number was saved with spaces to the left or not. This, BTW, is a
good technique if your invoice number field is varchar instead of char.
Rafael Copquin
El 30/08/2010 23:03, Sytze de Boer escribió:
> I have now seen it with mine own eyes and stopped cursing my client
>
> In my invoicig system, a client can save all the invoices and print them at
> the end of the month
> This client runs Window Server 2008 with 15 work stations
>
> He will select all the invoices for clients whose code starts with "1" to
> print
> On this ONE workstation, these invoices do not come out in code order
> I was there this morning and the invoices came out as follows
> 10011
> 10017
> 10019
> 10049
> 10043
> 1008
> 10045
> 10051
> (the codes are stored in a Character field)
>
> The proces starts with
> SET ORDER TO 1 (code order)
> The order is correct if I do it from another workstation
>
> I think it started to happen when we changed server to 2008
> I'm thinking printer driver
> Any thoughts?
>
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.