cPolicySymbol cPolicyNumber tPolicyEffectiveDate tPolicyExpirationDate iEffSrcID iExpSrcID BA1 0000103 1994-07-01 12:00:00 AM 2002-07-01 12:00:00 AM 2 1I have gotten it down to an interim table that is not quite there:
Cpolicysymbol Cpolicynumber Tpolicyeffectivedate Tpolicyexpirationdate iAppID BA1 0000103 2001.07.01 12:00:00 AM 2002.07.01 12:00:00 AM 1 BA1 0000103 1994.07.01 12:00:00 AM 2001.07.01 12:00:00 AM 2What I am trying to do now is use the lowest tPolicyEffectiveDate value among the
Select ; cPolicySymbol , cPolicyNumber , ; Min(tPolicyEffectiveDate) as tPolicyEffectiveDate , ; Max(tPolicyExpirationDate) as tPolicyExpirationDate , ; iAppID ; From PremPolicyXref Where ; cPolicySymbol = "BA1" and cPolicyNumber = "0000103" and iPremApplicationID = 1 ; or cPolicySymbol = "BA1" and cPolicyNumber = "0000103" and iPremApplicationID = 2 ; Group by cPolicySymbol , cPolicyNumber , iPremApplicationIDI will be calling this SQL with ADO on the VFPOLEDB provider, so I need to get it into