web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Error message: The value 24.09.2019 00:00:00 cannot be converted to a DateTime.

(0) ShareShare
ReportReport
Posted on by

Hi, guys,
how can I solve the following problem?

The value 24.09.2019 00:00:00 cannot be converted to a DateTime.

What am I doing wrong here?

Here is my code:

LOCAL TextToDateTime(Value : Text) : DateTime
DateTimeAsVariant := DateTimeValue;
IF NOT TypeHelper.Evaluate(DateTimeAsVariant, Value, '', 'en-us') THEN
  ERROR('Der Wert %1 kann nicht in ein DateTime überführt werden', Value);
DateTimeValue := DateTimeAsVariant;
EXIT(DateTimeValue);

I have the same question (0)
  • Verified answer
    Rehan Satti Profile Picture
    634 on at

    Hi Malue,

    You can seprate the string in to data and time and then convert it to datetime variable.

    TestDate := 24.09.2019;

    TestTime :=  00:00:00;

    TestDateTime := CREATEDATETIME(TestDate,TestTime);

    for more details look at the following link

    https://docs.microsoft.com/en-us/dynamics-nav/createdatetime-function--datetime-

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.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,917

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,161 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,025 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans