You need to sign in to do that
Don't have an account?
sfdcdev.ax551
How can I compare datetime with date for e.g. "where trunc(createddate)='2009-11-15'"
Hi,
How can I compare a datetime field with date something similar to oracle's trunc function?
Thanks
I am not aware of an existing function in SOQL that will support your query. Instead, you will need to either:
a) WHERE CreatedDate > 2009-11-15T00:00:00.000Z AND CreatedDate < 2009-11-16T00:00:00.000Z
b) WHERE CreatedDate = TODAY
c) WHERE CreatedDate__c = 2009-11-15
C assumes that you have a custom field called CreatedDate__c, which would be a formula that reads "DateValue(CreatedDate)" (without quotes), using a return type of "Date". Note that dates should not be quoted, unlike SQL.