Here is the example how to access only date from created date.
Code:
Contact c = [select id,createddate from contact where id = '0039000000NnjE6'];
datetime dt = c.createddate;
date createddt = dt.date();
Important : Hit Kudos if this provides you with useful information and if this is what you where looking for then please mark it as a solution for other benefits.
Hi nisha,
Here is the example how to access only date from created date.
Code:
Important :
Hit Kudos if this provides you with useful information and if this is what you where looking for then please mark it as a solution for other benefits.
Thank You,
Hitesh Patel
SFDC Certified Developer & Administrator
Hi Nisha
For trigger
Date Fieldvalue1 = objvariable.CreatedDate.date();
For formula field Datetime conversion to Date. You can use:
DATEVALUE(expression)