Dates [AX 2012]
Updated: February 28, 2012
Applies To: Microsoft Dynamics AX 2012 R3, Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012
The date data type holds a complete date; that is, day, month, and year.
|
Date declaration |
= |
date Variable { , Variable } ; |
|
Variable |
= |
Identifier [ option ] |
|
Option |
= |
arrayoptions | initialization |
//Simple declaration of a date variable, d date d; //Multiple declaration of two date variables date d1, d2; //A date variable, d3, is initialized to the 21st of November 1998 date d3 = 21\11\1998; //Declaration of a dynamic array of dates date d4[];
Dates are not automatically converted into other types, but you can use integer values in the computation of dates. For example:
void myMethod()
{
int anInteger;
date aDate;
;
// Sets the date variable adate to January 1, 1998
aDate = 1\1\1998;
// Sets the integer variable anInteger to 30.
anInteger = 30;
// Sets aDate to aDate + 30; that is the 31st of January 1998
aDate = aDate + anInteger;
}
Announcements: New book: "Inside Microsoft Dynamics AX 2012 R3" now available. Get your copy at the MS Press Store.
Community Additions
ADD
Show: