Monday 19 December 2016

Import / read date from excel to table.

Issue when import or read date type value from excel or csv file

Hi,
In excel or csv file let it be in string format itself. after that check your date format in system (AOS machine) whether it is MM/dd/yyyy or dd/MM/yyyy...

Example-1,

Suppose, your system date is in MM/dd/yyyy and you mapped Trans date in column 1 then:
 
Str                 dueDate;
dueDate                      = conpeek(con,1);
TableTMP.TransDate = str2date(dueDate,213);

Example-2,

Suppose, your system date is in dd/MM/yyyy and you mapped Trans date in column 1 then:
 
TableTMP.TransDate = str2date(conpeek(con,1),123);

Happy DAXing...

No comments:

Post a Comment