Your question doesn't make a lot of sense. Are you trying to export the *results* of an SQL statement to a file? http://www.tizag.com/phpT/filewrite.php -- Joe On Aug 17, 2010, at 9:25 AM, Roger Head wrote: > What is the best way to Export a Sql statment to a CSV or Excel file? > Roger Head [Non-text portions of this message have been removed]