Mike,

In the cfquery statement, is there a dbtype="query" declaration, or is there a 
datasource="" statement?

If its a dbtype="query", the that qry snippet is querying another cfquery 
written above the one in question.  

If a datasource is defined, then check that datasource in the CFAdmin and where 
it points to, and there should be a table or view defined for that database.

Hope I could help.

Sincerely,
__________________________
John Youngman
[email protected]
http://www.linkedin.com/in/johngyoungman





On Dec 6, 2010, at 5:19 PM, mike barnes wrote:

> Hi everyone,
> 
> I am new to Cold Fusion and have been tasked with maintaining an existing 
> application and am having a little trouble following the code.
> 
> Specifically, I am unable to understand the following cfquery snippet and how 
> the from clause is figuring out what the table is:
> 
> ------------------- Code below ---------------------
>       SELECT *
>       FROM qryGetVisitRecords
>               <cfif form.assigned_month_filter neq "" and not 
> listFind("asc,desc", form.assigned_month_filter)>
>               , qryGetAssignedMonths
>       WHERE qryGetAssignedMonths.sitecompany_id = 
> qryGetVisitRecords.sitecompany_id
> ----------------------------------------------------------
> 
> The issue is that I do not have a qryGetVisitRecords table or view. Also, do 
> not have a qryGetAssignedMonths table or view. So, the question is where to I 
> find how the query is calculating the table name. And, is there a way to trap 
> the sql statement so that I can visually inspect it.
> 
> 
> Thanks
> Mike Barnes
> 

Reply via email to