Thanks but that will skip all the sub-folder files and their sizes.
>Chuck,
>
>Try this:
>
>SELECT cDir, SUM(nSize) as nDirSize ;
> FROM foo ;
> WHERE OCCURS('\', cDir) = 2 ;
> GROUP BY cDir
>
>HTH,
>Chad
>
>>I have a program that goes down the directory structurer getting a list of all the files in the path. What I need now is to be able to sum up the records by a selected depth.
>>
>>My data has three fields dir, file, size and looks something like this
>>
>>C:\WINDOWS\ CLOCK.AVI 82944
>>C:\WINDOWS\ COFFEE BEAN.BMP 17062
>>C:\WINDOWS\TEMP\ 0004254.TMP 850
>>C:\TEST\ VPF600.DLL 5701
>>
>>
>>I can put an index on OCCURS('\', dir) and then do a select to get the unique root folders like
>>
>> SELECT DIST dir FROM ac_files WHERE OCCURS('\', dir) = 2
>>
>>But I was looking for a select statement that would also sum up all the files and subfolder files sizes for that directory.
Charles
"The code knows no master." - Chuck Mautz
"Everybody is ignorant, only on different subjects." - Will Rogers