Hello all,

Sorry for the vague description; not sure what to call it to describe it.. I'm currently trying to work out a problem in an Access system that involves updating 11k records containing a date field.

I've got to update a field, tblProduct.dtmFDIS based on the following:
Its current value must be null
The value to be inserted into tblProduct.dtmFDIS is taken from tblImport.dtmFrom

The tblImport table contains strProdCode, dtmFrom, Var1, Var2 and Var3 and the data in tblImport is imported weekly.

What I have for example is this:
strProdCode dtmFrom Var1 Var2 Var3
00001 3/29/2010 0 0 0
00001 3/29/2010 0 0 1
00001 4/12/2011 1 1 0
00002 3/29/2010 0 0 0
00002 5/10/2012 1 0 0

What I need to accomplish is to select the earliest dtmFrom for all unique strProdCodes where Var1+Var2+Var3 > 0 and set tblProduct.dtmFDIS = tblImport.dtmFrom
Thus giving me for strProdCode 00001 a dtmFrom of 3/29/2010 and for strProdCode 00002 a dtmFrom of 5/10/2012. I'm dealing with about 500k rows of import data, so going through it manually just isn't an option :P

I'm looking for an SQL query (or many) that will accomplish this. Any help would be greatly appreciated.
Cheers

-Dan