AgileApps Support Wiki Pre Release

Difference between revisions of "DATEPART"

From AgileApps Support Wiki
imported>Aeric
imported>Aeric
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
The DATEPART function returns a DATE value that is normalized to the start of the day, for use in comparisons.  
The DATEPART function returns a date/time value that is normalized to the start of the day, to match other date/time values on the same day.


To get a string that contains the date only, use:
:'''Note:'''<br> To get a string that contains the date only, use this:
:<syntaxhighlight lang="java" enclose="div">
:<syntaxhighlight lang="java" enclose="div">
TEXT(MONTH(date_modified))+'/'+TEXT(DAY(date_modified))+'/'+TEXT(YEAR(date_modified))   
TEXT(MONTH(date_modified))+'/'+TEXT(DAY(date_modified))+'/'+TEXT(YEAR(date_modified))   
Line 7: Line 7:


;Syntax:
;Syntax:
 
:<syntaxhighlight lang="java" enclose="div">
DATEPART('<tt>[[dString]]</tt>'))
DATEPART('<tt>[[dString]]</tt>'))
</syntaxhighlight>


;Return:A date in the format defined by [[Date Format]]
;Return:A date in the format defined by [[Date Format]]


;Examples:
;Examples:
 
:<syntaxhighlight lang="java" enclose="div">
DATEPART('04/22/2009 03:15 am') ='04/22/2009 12:00:00 AM'
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'
DATEPART(DATE ('2009', '04', '22', '03', '15',  '00')) = '04/22/2009 12:00:00 AM'
</syntaxhighlight>
<noinclude>
<noinclude>


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

Latest revision as of 21:49, 8 February 2012

The DATEPART function returns a date/time value that is normalized to the start of the day, to match other date/time values on the same day.

Note:
To get a string that contains the date only, use this:
TEXT(MONTH(date_modified))+'/'+TEXT(DAY(date_modified))+'/'+TEXT(YEAR(date_modified))
Syntax
DATEPART('<tt>[[dString]]</tt>'))
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'