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

Updating a DateTime Field To Null
I'm trying to run an UPDATE statement in SOQL to set a DateTime field back to NULL (or whatever the default value is in Salesforce for DateTime fields) and running into issues with this. Here are some of the statements I've tried to run with no success:
UPDATE CustomObject__c SET DateTimeField__c = NULL WHERE OtherField__c = 'value'
UPDATE CustomObject__c SET DateTimeField__c = null WHERE OtherField__c = 'value'
UPDATE CustomObject__c SET DateTimeField__c = '' WHERE OtherField__c = 'value'
UPDATE CustomObject__c SET DateTimeField__c = ' ' NULL WHERE OtherField__c = 'value'
Does anyone have any thoughts as to how this should work?
UPDATE CustomObject__c SET DateTimeField__c = NULL WHERE OtherField__c = 'value'
UPDATE CustomObject__c SET DateTimeField__c = null WHERE OtherField__c = 'value'
UPDATE CustomObject__c SET DateTimeField__c = '' WHERE OtherField__c = 'value'
UPDATE CustomObject__c SET DateTimeField__c = ' ' NULL WHERE OtherField__c = 'value'
Does anyone have any thoughts as to how this should work?
All Answers
Firsly I would say that the way you have mentioned is not the way to update record in soql Here is the correct way below
Account a = new Account();
a = [select id,LaunchDatetime__c from Account where id ='00190000019VAShAAO'];
a.CSopke1__LaunchDatetime__c = NULL ;
update a ;
Thanks
Sandeep Singhal
http://www.codespokes.com/