Interesting.
Hey Mike, sorry to raise this thread from the dead, but did either you or
mramsey figure out what this issue was?
I'm getting the same error:
Code:
1292: Incorrect datetime value: '2010-06-02T23:20:54.000Z' for column 'CreatedDate' at row 1
I'm using your code from this post:
http://www.mikesimonds.com/synchroni...1.html#post906
With the the latest adodb-511-for-php5, and the PHPToolKit from your homepage.
It's been almost two years since this post was first made, but I'm hoping you can remember what the resolution was.
Thanks again for such an awesome site!
UPDATE:
I found a crappy work-around. I've changed these date fields to be VARCHAR(30) in MySQL, and the export works fine.
I then added a short bit of code at the end of the script to update other MySQL fields with the proper DATETIME values:
PHP Code:
$soql = "Select Id, IsDeleted, MasterRecordId, Name, ParentId, BillingStreet, BillingCity, BillingState, BillingPostalCode, BillingCountry, Phone, Fax, Website, OwnerId, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp, LastActivityDate, Primary_Category__c, Do_Not_Call__c, Do_Not_Fax__c, Additional_Categories__c, Additional_Market_Areas__c, County__c, NOLO_Lead_Source__c, Lead_Source_Detail__c, Do_Not_E_Mail__c, Telesales_Agent__c, Primary_Market_Area__c, pymt__Convert_To_Person_Account__c, Code__c, Phone_2__c, Notes__c, Taking_new_Clients__c, Old_SF_Record_ID__c, Add_l_Info__c, Number_of_Contacts__c FROM Account";
//Processes the query to get account information from Salesforce
$records = get_records($client, $soql, $db);
// Here I update two of my "custom" fields in MySQL (DateCreated and DateLastModified):
$sql = "UPDATE $table SET DateCreated = LEFT(CreatedDate,23), DateLastModified = LEFT(LastModifiedDate,23)";
$db->Execute($sql);
if ($db)
{
echo "dates updated\n";
}
else
{
echo "Failed";
var_dump($db->ErrorMsg());
exit();
}
exit;
Bookmarks