Coding file into 4ths

  • Thread starter Thread starter Hal Pratt
  • Start date Start date
H

Hal Pratt

I have customer file with hundreds of unique autonumbers [ID] which need to
be coded into 4 groups of equal size. Is there a way to do it in with a
single expression?
 
Define what you mean by "coded".

Use 4 make table queries to write the data from the 1 table to each of the 4
tables.


--
HTH,

Steve Clark, Access MVP
FMS, Inc.
Professional Solutions Group
http://www.FMSInc.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Is your Access database too slow?
Are you ready to upgrade to SQL Server?
Contact us for optimization and/or upsizing!
http://www.FMSInc.com/consulting
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 
What I'm looking to do is Nth code a list into fourths (i.e., record 1=A,
rec 2=B, rec 3=C, rec 4=D, rec 5=A, rec 6=B and so on)

[MVP] S.Clark said:
Define what you mean by "coded".

Use 4 make table queries to write the data from the 1 table to each of the 4
tables.


--
HTH,

Steve Clark, Access MVP
FMS, Inc.
Professional Solutions Group
http://www.FMSInc.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Is your Access database too slow?
Are you ready to upgrade to SQL Server?
Contact us for optimization and/or upsizing!
http://www.FMSInc.com/consulting
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Hal Pratt said:
I have customer file with hundreds of unique autonumbers [ID] which need to
be coded into 4 groups of equal size. Is there a way to do it in with a
single expression?
 
Not sure about your table structure and values but if you want to group
Customers in the Northwind database based on their customer id:
SELECT ((SELECT Count(*) FROM Customers c
WHERE c.CustomerID <Customers.CustomerID)*4) \
(SELECT Count(*) FROM Customers) AS GroupNumber,
Customers.CustomerID, Customers.CompanyName
FROM Customers;

1/4th of the customers will have GroupNumber = 0. 1/4th will be 1 etc.
--
Duane Hookom
MS Access MVP


Hal Pratt said:
What I'm looking to do is Nth code a list into fourths (i.e., record 1=A,
rec 2=B, rec 3=C, rec 4=D, rec 5=A, rec 6=B and so on)

[MVP] S.Clark said:
Define what you mean by "coded".

Use 4 make table queries to write the data from the 1 table to each of
the
4
tables.


--
HTH,

Steve Clark, Access MVP
FMS, Inc.
Professional Solutions Group
http://www.FMSInc.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Is your Access database too slow?
Are you ready to upgrade to SQL Server?
Contact us for optimization and/or upsizing!
http://www.FMSInc.com/consulting
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Hal Pratt said:
I have customer file with hundreds of unique autonumbers [ID] which
need
to
be coded into 4 groups of equal size. Is there a way to do it in with a
single expression?
 
Back
Top