Announcements
No record found.
Dear expert ,
how to rectify in al "Cannot implicitly convert type date to datetime" using al
AL is not different than C/AL.
If you have a DATE field and you want to convert it to a DATETIME field, you need to use:
YourDateTimeField := CREATEDATETIME(YourDateField,0T);
Hello steffan
showing as error please find below screenshot
To create a DATETIME VALUE, you need a Date and a Time value. Here it's missing the TIME part. Check my post above, I've written:
CREATEDATETIME(YourDateField,0T);
You need to write:
YourDateTimeVariable := CreateDateTime("Posting Date",0T);
Below is the function signature for "CREATEDATETIME".
DateTime := CREATEDATETIME(Date, Time)
It takes 2 parameters in. However in your code you have only provided a one (Date). Since you do not have a time value, what you can do is pass 0T.
"Posting Date" := CREATEDATETIME("Posting Date",0T);
Please refer below UTL for more info : https://docs.microsoft.com/en-us/dynamics-nav/createdatetime-function--datetime-
Dear sir, I tried to do as follow
when I run in my local, the system display message as below. how can I solve this?
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.
Congratulations to a top community star!
In our never-ending quest to help the Dynamics 365 Community members get answers faster …
Welcome to the next edition of the Community Platform Update. This is a status …
Stay up to date on forum activity by subscribing.