Some quick tips on how to populate a date variable.
Example 1: The use of function mkdate
TransDate myDate=mkdate(15,9,2009);
This function creates a date based on three integers, which indicate day, month and year. So mkdate(day,month,year).
As an alternative, you can use this:
Example 2: The use of function str2date
TransDate myDate=str2date('15/09/2009',123);
The function str2date converts a text string to a date value. The second argument gives the used formatting of the date string. (Where 1 stands for day, 2 for month and 3 for year.)
There is a similar function to create a DateTime value, namely str2datetime.
Use:
TransDateTime myDateTime=str2datetime( "15/09/2009 20:39:00" ,123 );
So, plenty of choice, whichever suits you.
Tuesday, September 15, 2009
Subscribe to:
Post Comments (Atom)
hi,
ReplyDeletehow to read from the date dynamically from a date field on the form ...
hi,
ReplyDeletei want to know how many combinations are possible in AX for str2Date().
are 9 combinations of dates format is possible in AX?
daily proxy list created daily new fresh proxy list
ReplyDelete