You need to sign in to do that
Don't have an account?

Can't access Date fields via SOQL / Relationship query?
In the 14.0 API, SOQL seems to return inconsistent results for date fields such as "BirthDate" and "LastActivityDate."
For example, I've submitted this query via both the Data Loader and the API directly:
In both cases, no value is returned for the LastActivityDate and BirthDate fields, even though I can verify that these fields are populated in the UI for the contacts returned. If I examine the XML returned from the API, I find
so Salesforce is definitely returning a null value for this field; it's not a parsing problem.
If I remove the "relationship" part of the query and just query against one of the contacts directly
BirthDate is returned correctly, but not LastActivityDate.
Any idea what's going on? The objective of the original query was to return a list of campaign member names, addresses, and the last activity date for the contact or lead. I can retrieve other, non-date fields from contacts and leads just fine.
Message Edited by billk on 11-24-2008 01:52 PM
For example, I've submitted this query via both the Data Loader and the API directly:
Code:
SELECT Id, Contact.FirstName, Contact.LastActivityDate, Contact.BirthDate FROM CampaignMember WHERE CampaignId = '70120000000Edd4AAC' and ContactId != NULL
Code:
<sf:LastActivityDate xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sf="urn:sobject.partner.soap.sforce.com" />
If I remove the "relationship" part of the query and just query against one of the contacts directly
Code:
SELECT Id, FirstName, BirthDate, LastActivityDate FROM Contact WHERE Contact.Id = '0032000000HaHxf'
BirthDate is returned correctly, but not LastActivityDate.
Any idea what's going on? The objective of the original query was to return a list of campaign member names, addresses, and the last activity date for the contact or lead. I can retrieve other, non-date fields from contacts and leads just fine.
Message Edited by billk on 11-24-2008 01:52 PM
Select c.Id, c.Contact.FirstName, c.Contact.LastName from CampaignMember c
where c.ContactId <> '' and c.CampaignId = 'xxxxxxxxxx'
For the record, there were actually two issues: