I am writing the code to get the data from ax in to excel, but date field is coming is like as 01-05-2016 10:23:34
i want only date..
*This post is locked for comments
You can easily convert datetime to date, but I can't comment on your code, because you didn't tell us anything about it. Also you can change the format in Excel.
Hi srinivas pamidi,
You can use DateTimeUtil::date() to convert date time to date in x++ code.
Hi ievgen Miroshnikov,
In Debugger it is showing Date in excel sheet it is showing as Date time.
I am already Try this But it is Showing Error.
Argument 't' is incompatable with the required type.
xlsWorkSheet.cells().item(row,2).value(DateTimeUtil::date(budgetTmpBalanceLocal.Period));
budgetTmpBalanceLocal.Period is already a date so you cannot convert date to date.
Could you please try to use xlsWorkSheet.cells().item(row,2).value(strfmt('%1', budgetTmpBalanceLocal.Period));
This will work :)
xlsWorkSheet.cells().item(row,2).value(date2Str(budgetTmpBalanceLocal.Period, 123, 2, DateSeparator::Hyphen, 2, DateSeparator::Hyphen, 2,true));
Output:
01-05-2016
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Tocauer 4
AlissonGodoy 2
NNaumenko 2