I believe this is to be a possible bug in Sugar. I found this on Release 6.1.0 Professional. When creating a report that has a related document field, the report fails and states:

"Database failure. Please refer to sugarcrm.log for details."

Looking into the sugarcrm logs it produces this error in debug.

" LIMIT 0,100: MySQL error 1054: Unknown column 'documents1.name' in 'field list'"

So looking at the full query it indeed says documents1.name (documents1 being the alias) and with tweeking the correct field should be documents1.document_name . Rerunning the query through the database, I get a working report.

Now need to find the piece of code in sugar.

Looking into "modules/Reports/Report.php" I come across the bit where the part of the query (the select section) is being created. Function "create_select" and on line 1189 is where in my instance the documents.name is being created.

So for a quick fix for the moment I needed to put in an if statement to catch any modules that are Documents just under line 1189

Code:
if($extModule->module_dir == 'Documents'){
		            	$select_piece = $secondaryTableAlias.'.document_name '. $secondaryTableAlias.'_name';
		            }
I couldn't find this in the Bug Tracker, and wondering if anyone else has.