Re: Coding file into 4ths
From: Duane Hookom (duanehookom_at_NO_SPAMhotmail.com)
Date: 02/12/04
- Next message: fredg: "Re: Help with IIf statement"
- Previous message: Duane Hookom: "Re: query joints."
- In reply to: Hal Pratt: "Re: Coding file into 4ths"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 11 Feb 2004 20:12:46 -0600
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" <pdihal@comcast.net> wrote in message news:d8KdnQwI5qtAVbfdRVn-gg@comcast.com... > 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" <Steve.Clark_NOSPAM@FMSInc.com> wrote in message > news:eTXno797DHA.1948@TK2MSFTNGP12.phx.gbl... > > 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" <pdihal@comcast.net> wrote in message > > news:gICdnaB0FPlC2rXdRVn-ug@comcast.com... > > > 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? > > > > > > > > > > > >
- Next message: fredg: "Re: Help with IIf statement"
- Previous message: Duane Hookom: "Re: query joints."
- In reply to: Hal Pratt: "Re: Coding file into 4ths"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|