Difference between revisions of "DATEPART"

From AgileApps Support Wiki
imported>Evelyn
m
 
imported>Aeric
Line 1: Line 1:
The DATEPART function used with the DATE function to extract the date.
The DATEPART function returns a DATE value that is normalized to the start of the day, for use in comparisons.
 
To get a string that contains the date only, use:
:<syntaxhighlight lang="java" enclose="div">
TEXT(MONTH(date_modified))+'/'+TEXT(DAY(date_modified))+'/'+TEXT(YEAR(date_modified)) 
</syntaxhighlight>


;Syntax:
;Syntax:
Line 9: Line 14:
;Examples:
;Examples:


  DATEPART('04/22/2009 03:15 am') ='04/22/2009'
  DATEPART('04/22/2009 03:15 am') ='04/22/2009 12:00:00 AM'
   
   
  DATEPART(DATE ('2009', '04', '22', '03', '15',  '00')) ='04/22/2009'
  DATEPART(DATE ('2009', '04', '22', '03', '15',  '00')) ='04/22/2009 12:00:00 AM'
 
<noinclude>


[[Category:Formula Functions]]
[[Category:Formula Functions]]
</noinclude>

Revision as of 21:38, 8 February 2012

The DATEPART function returns a DATE value that is normalized to the start of the day, for use in comparisons.

To get a string that contains the date only, use:

<syntaxhighlight lang="java" enclose="div">

TEXT(MONTH(date_modified))+'/'+TEXT(DAY(date_modified))+'/'+TEXT(YEAR(date_modified)) </syntaxhighlight>

Syntax
DATEPART('dString'))
Return
A date in the format defined by Date Format
Examples
DATEPART('04/22/2009 03:15 am') ='04/22/2009 12:00:00 AM'

DATEPART(DATE ('2009', '04', '22', '03', '15',  '00')) ='04/22/2009 12:00:00 AM'