Dear Vixens and Reynards:
I just had to investigate the use of Work Function Codes
(abbrev: WFC, column name: funccode) in the client billing system
that I maintain.
A WFC is what was charged for. There can be different WFC for
different clients and even for classes of work done (e.g. order
fulfillment and returns handling) for a client. A WFC is also valid
for a limited time; this is how rate changes are implemented.
Among the WFC columns is unitmeas (Unit of Measure).
I was looking for WFC which had more than one unitmeas
used. For example, billed by package and by pallet with different
WFC of the same name.
I came up with the following code. It seems a bit long. Can
it be done in fewer queries?
***** Start of Code *****
* tmp
* WFC Checkout
* Last Modification: 2015-11-10
? "*** Execution begins."
? program()
close all
clear all
set talk off
set exact on
set ansi on
*
* Get all pairs of funccode-unitmeas used.
select funccode,unitmeas from cwkf;
group by funccode,unitmeas;
order by funccode,unitmeas;
into cursor pairs
browse normal
* Get all funccode where there is more than one funccode-unitmeas.
select funccode,count(*) as thecount from pairs;
group by funccode;
having thecount>1;
order by funccode;
into cursor multis
browse normal
* Get all funccode-unitmeas where there is more than one for a funccode.
select funccode,unitmeas from cwkf;
where funccode in (select funccode from multis);
group by funccode,unitmeas;
order by funccode,unitmeas;
into cursor varmints
browse normal
*
close all
clear all
? "*** Execution ends."
return
***** End of Code *****
Sincerely,
Gene Wirchenko
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/
** 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.