Try this:

<CFQUERY name="get_tasks" datasource="taskomatic">
         SELECT
                 tasks.task_id,
                 tasks.name as tasks_name,
                 tasks.deadline,
                 tasks.project_id,
                 tasks.importance_id,
                 tasks.owner_id,
                 projects.project_id,
                 projects.name as projects_name,
                 people.person_id,
                 people.name as people_name,
                 importance.importance_id,
                 importance.importance
         FROM tasks
                 JOIN projects ON tasks.project_id = projects.project_id
                 JOIN people ON tasks.owner_id = people.person_id
                 JOIN importance ON tasks.importance_id =
importance.importance_id
</CFQUERY>

    <CFOUTPUT query="get_tasks">
      <td>#tasks_name#</td>
      <td>#projects_name#</td>
      <td>#deadline#</td>
      <td>#importance#</td>
      <td>#people_name#</td>
    </CFOUTPUT>


On Mon, 17 Jan 2005 17:55:41 +0000, Chris Kavanagh <[EMAIL PROTECTED]> wrote:
> Dear list,
> 
> I've got this query that gets data from three tables:
> 
> <CFQUERY name="get_tasks" datasource="taskomatic">
>         SELECT
>                 tasks.task_id,
>                 tasks.name,
>                 tasks.deadline,
>                 tasks.project_id,
>                 tasks.importance_id,
>                 tasks.owner_id,
>                 projects.project_id,
>                 projects.name,
>                 people.person_id,
>                 people.name,
>                 importance.importance_id,
>                 importance.importance
>         FROM tasks
>                 JOIN projects ON tasks.project_id = projects.project_id
>                 JOIN people ON tasks.owner_id = people.person_id
>                 JOIN importance ON tasks.importance_id = 
> importance.importance_id
> </CFQUERY>
> 
> But the trouble is, the CFOUTPUT I thought would work doesn't:
> 
>    <CFOUTPUT query="get_tasks">
>      <td>#tasks.name#</td>
>      <td>#projects.name#</td>
>      <td>#tasks.deadline#</td>
>      <td>#importance.importance#</td>
>      <td>#people.name#</td>
>    </CFOUTPUT>
> 
> ...because it doesn't seem to recognise the scopes ("Element TASKS.NAME
> is undefined in TASKS").  But I need the scopes because I (perhaps
> foolishly) have three fields called "name"!  Do I need to make all the
> field names in my database unique, or is there another way?
> 
> TIA!
> CK.
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190800
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to