RunTime error in an advanced query 

RunTime error in an advanced query 

  
Hello guys,
 
I'm having a strange error in an advanced query, when I do the query in the service studio (hitting the test button) the query runs fine and give the output that I want, but when I run the application it gives me this error:

 

Error in advanced query GetUpdatedJobOrders in UpdateCRMRec in EgenCRM2CatsIntegrat (SELECT {opportunities_cstm}.[id_c] , a.[user_name] Recruiter, {cats_company}.[name], b.[user_name] Owner, {joborder_cats}.[title] , {joborder_cats}.[notes] , {joborder_cats}.[type] , {joborder_cats}.[openings] , {joborder_cats}.[city] ,  {joborder_cats}.[state] , {opportunities_cstm}.[cats_sync_date_c] , {joborder_cats}.[date_created] , {joborder_cats}.[joborder_id] , {joborder_cats}.[company_id] , {joborder_cats}.[recruiter] , {joborder_cats}.[owner]    FROM {joborder_cats} , {opportunities_cstm} , {cats_users} a , {cats_users} b , {cats_company}  WHERE {joborder_cats}.[joborder_id] = {opportunities_cstm}.[joborderid_c]  AND {joborder_cats}.[date_modified] > {opportunities_cstm}.[cats_sync_date_c]  AND {joborder_cats}.[recruiter] = a.user_id  AND {joborder_cats}.[owner] = b.user_id   AND {joborder_cats}.[company_id] = {cats_company}.[company_id]     ): Duplicate column name 'recruiter'
 
?its very strange because I run the output query in my database and the output is also correct. 
 
Output query:

SELECT `crm`.`opportunities_cstm`.`id_c` , a.`user_name` Recruiter, `crm`.`cats_company`.`name`, b.`user_name` Owner, `crm`.`joborder_cats`.`title` , `crm`.`joborder_cats`.`notes` , `crm`.`joborder_cats`.`type` , `crm`.`joborder_cats`.`openings` , `crm`.`joborder_cats`.`city` ,
 `crm`.`joborder_cats`.`state` ,  `crm`.`opportunities_cstm`.`cats_sync_date_c` ,  `crm`.`joborder_cats`.`date_created` ,  `crm`.`joborder_cats`.`joborder_id` ,  `crm`.`joborder_cats`.`company_id` ,  `crm`.`joborder_cats`.`recruiter` ,  `crm`.`joborder_cats`.`owner`   
FROM  `crm`.`joborder_cats` ,  `crm`.`opportunities_cstm` ,  `crm`.`cats_users` a ,  `crm`.`cats_users` b ,  `crm`.`cats_company` 
WHERE  `crm`.`joborder_cats`.`joborder_id` =  `crm`.`opportunities_cstm`.`joborderid_c` 
AND  `crm`.`joborder_cats`.`date_modified` >  `crm`.`opportunities_cstm`.`cats_sync_date_c` 
AND  `crm`.`joborder_cats`.`recruiter` = a.user_id 
AND  `crm`.`joborder_cats`.`owner` = b.user_id  
AND  `crm`.`joborder_cats`.`company_id` =  `crm`.`cats_company`.`company_id`

 
Do any of you have any idea ? 
 
Thank you very much.
 
Gustavo
 
its very strange 

Hi Gustavo,

Just from quickly looking over your post I was thinking the error had to do with the following: {joborder_cats}.[recruiter] and a.[user_name] Recruiter

If you change the alias of a.[user_name] Recruiter or give an alias other than Recruiter to {joborder_cats}.[recruiter] do you still see this error?

Justin