>>I would suggest to stop trying to do the whole job with one query. Keep your original query to get the dat with memos with an added filed for firstvideo number like "..., 0 as FirstVideo ...". Make that query READWRITE. Then do a scan loop and fire my suggestion to simply get the first video number for each program. Something like this;
>
>This is coming from VB.NET by the use of OleDB, so I have to do everything in one big SQL.
Is this against SQL Server or VFP? If it is SQL Server you could make each of those queries a view and then make a single join between them in ADO for the VB code.