Base: Nested query question

Hi, I’m trying to do the following using a nested query and just can’t get it to work. I have a table “Table1” and two fields “DND” integer, and “DATE” a date! and thousands of records. I need to get the average of the “DND” field for the last 200 records as defined by date. So I thought ! SELECT * FROM “Table1” ORDER BY “DATE” Desc Limit 200, nested inside SELECT AVG(“DND”) FROM “Table1”. I have tried various combinations but nothing works. Any help appreciated.

Without an example, not tested:

SELECT AVG(“DND”) FROM “Table1” 
WHERE "DATE" IN (SELECT "DATE" FROM “Table1” ORDER BY “DATE” Desc Limit 200)

RobertG: Yea that works perfectly thanks, so simple when you know how!