+ Start a Discussion
Data Warehouse ReportsData Warehouse Reports 

Query combining columns in output

I have this query below where in the output Account.Corportate_Code__c and Account.Industry column values are being concatenated as "AccountSNHUEducation" .

Account.Corportate_Code__c has value = SNHU
Account.Industry = Education

SELECT id,Account.Corportate_Code__c, StartDate, EndDate,Number_of_Backup_days_in_contract__c,Account.Industry, CreatedDate, LastModifiedDate, (SELECT id FROM Opportunities) FROM Contract WHERE Status = 'Activated' AND RecordTypeId = '01270000000Hp9oAAC'

I am running this query in Python and my code is:
query = (
                "SELECT Account.Corportate_Code__c, id, Account.Industry,  (SELECT id FROM Opportunities)  FROM Contract WHERE Status = 'Activated' AND RecordTypeId = '01270000000Hp9oAAC'")
            records = svc.query(query)
for rec in records[sf.records:]:
                        print  str(rec[1]) + " : " + str(rec[2]) + " : " + str(rec[3]) + " : " + str(rec[4])

Abu HashimAbu Hashim

Can u please let us know, under which field are u getting " AccountSNHUEducation" value? Did u try to print ur values using system.debug statements? That would help you debug better.
Data Warehouse ReportsData Warehouse Reports
I am getting it in str(rec[2]). I am not aware of system.debug.. I am completely new and dont have much of an idea.