I thought this problem would have been covered before, but I couldn't find anything.I have the following table:CREATE TABLE [Samples] ( [LotNr] [int] NOT NULL , [TypeId] [int] NOT NULL , [SizeId] [int] NOT NULL , [YieldRaw] [decimal](3, 2) NOT NULL , [YieldCooked] [decimal](3, 2) NOT NULL , [YieldDefrosted] [decimal](3, 2) NULL , [DestinationId] [int] NOT NULL , CONSTRAINT [PK_Samples] PRIMARY KEY CLUSTERED ( [LotNr] ) ON [PRIMARY] ) ON [PRIMARY]GO
Which holds sample information for our products. Results from several samples are stored in this table, and based on the TypeId, SizeId and the Yields a certain DestenationId is appointed to the specific LotNr (this is 'manually' done by our QA staff)What I want is to have the computer make a proposal which destinationId would suit the specific LotNr best, based on historical data in this table.It's easy to find the top (=most chosen) destinationId for the specific TypeId and SizeId, but I'm having trouble finding the closest match for the three yield fields.Thanks in advancePeterEdited by - Peter Dutch on 05/08/2003 05:16:21Edited by - Peter Dutch on 05/08/2003 05:17:03