Many thanks Bill - I should have guessed a temp view!
Regards,
Alastair.
----- Original Message -----
From: Bill Downall
To: RBASE-L Mailing List
Sent: Wednesday, February 11, 2009 12:10 PM
Subject: [RBASE-L] - Re: Update with min value problem
Alistair,
CREATE TEMP VIEW FirstFileMinDates (File_Code, MinFile_Date) AS +
SELECT File_Code, MIN (File_Date) +
FROM Files t2 +
GROUP BY File_Code
UPDATE FilesData +
SET FirstFileDate = t2.MinFile_Date +
FROM FilesData, Files t2 +
WHERE (FilesData.T1 = t2.File_Code)
Bill
On Wed, Feb 11, 2009 at 6:59 AM, Alastair Burr <[email protected]>
wrote:
I must be having (yet another) off-day:
I can't find a way to update one table with the min value from another
table:
UPDATE FilesData SET FirstFileDate = MIN(File_Date) +
FROM FilesData T1, Files T2 +
WHERE T1.IdNum = T2.File_Code
Thanks in advance for any guidance,
Regards,
Alastair
----------------------------
Alastair Burr
St. Albans, UK.
[email protected]
-----------------------------
------------------------------------------------------------------------------
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.0.234 / Virus Database: 270.10.20/1944 - Release Date: 02/10/09
17:44:00