DATE

(int Year)
Returns a new date with specified or default parameters.
Example: DATE(2016) returns a new date (2016-1-1 00:00:00.000)
Year: Optional. The year (1 through 9999). Defaults to 1.
(int Yearint Month)
Returns a new date with specified or default parameters.
Example: DATE(2016,1) returns a new date (2016-1-1 00:00:00.000)
Year: Optional. The year (1 through 9999). Defaults to 1.
(int Yearint Monthint day)
Returns a new date with specified or default parameters.
Example: DATE(2016,1,20) returns a new date (2016-1-20 00:00:00.000)
Year: Optional. The year (1 through 9999). Defaults to 1.
(int Yearint Monthint dayint hour)
Returns a new date with specified or default parameters.
Example: DATE(2016,1,20,1) returns a new date (2016-1-20 01:00:00.000)
Year: Optional. The year (1 through 9999). Defaults to 1.
(int Yearint Monthint dayint hourint minute)
Returns a new date with specified or default parameters.
Example: DATE(2016,1,20,1,2) returns a new date (2016-1-20 01:02:00.000)
Year: Optional. The year (1 through 9999). Defaults to 1.
(int Yearint Monthint dayint hourint minuteint second)
Returns a new date with specified or default parameters.
Example: DATE(2016,1,20,1,2,3) returns a new date (2016-1-20 01:02:03.000)
Year: Optional. The year (1 through 9999). Defaults to 1.
(int Yearint monthint Dayint hourint minuteint secondint millisecond)
Returns a new date with specified or default parameters.
Example: DATE(2016,1,20,1,2,3,400) returns a new date (2016-1-20 01:02:03.400)
Year: Optional. The year (1 through 9999). Defaults to 1.

Example 1

Create a Date key from only Year and Month information (defaulting to the 1st of every month):
date(&Year,&Month,"1")

Example 2

Create a Date key from one field that contains Year and Month information (defaulting to the 1st of every month):

date(left(&YearMonth,4),right(&YearMonth,len(&YearMonth)-5))
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.