Date String Convert isn't working

Date String Convert isn't working

cnaan123
Participant Participant
874 Views
7 Replies
Message 1 of 8

Date String Convert isn't working

cnaan123
Participant
Participant

Working with sdf features.

ToDate( Substr( DATE_STRING , 1, 10) , 'DD/MM/YYYY') is not working

0 Likes
Accepted solutions (2)
875 Views
7 Replies
Replies (7)
Message 2 of 8

Thomas_Stuehle
Alumni
Alumni

Hello @cnaan123 

 

Welcome to the Map 3D forum.

 

Generally speaking the functions are working. I would recommend to split it into separate functions and to validate them in between - e.g.:

  1. Check DATE_STRING
  2. Validate and check output
  3. Check Substr( DATE_STRING , 1, 10) 
  4. Validate and check output
  5. Check ToDate( Substr( DATE_STRING , 1, 10) , 'DD/MM/YYYY')
  6. Validate and check output

 





I suggest it is file specific and depends on the DATE_STRING. I also would like to reproduce it with your data. Can you please share the sdf file and confirm that the expected outcome is a date field with the format "DD/MM/YYYY"?

 

If you can't share the file here in the forum, please let me know and I will send you an invitation to upload the file somewhere else.

 

Best regards,

Thomas

 

 

-----------------------------
You found a post helpful? Then feel free to give likes to these posts!
Your question got successfully answered? Then just click on the 'Mark as solution' button.


Thomas Stühle
Technical Support Specialist
0 Likes
Message 3 of 8

ChicagoLooper
Mentor
Mentor

Would it be possible to upload a screen shot of your SDF's Table View. Adjust the width of the Table so the 'DATE COLUMN' is visible or show make the table wide enough to display all the columns. You don't need to make the table super tall, just tall enough to capture the top 6 rows.

Map task pane_Table.png

Chicagolooper

EESignature

0 Likes
Message 4 of 8

Thomas_Stuehle
Alumni
Alumni

Hello @cnaan123 

 

Could the information provided help you and answer your question?

 

If yes, please click on the "Accept as Solution" button as then also other community users can easily find and benefit from the information. If not please dont hesitate to give an update here in your topic so all members know what´s the progression on your question is and can suggest next steps that might be helpful for you to achieve what you´re looking for.

 

Best regards,

Thomas

-----------------------------
You found a post helpful? Then feel free to give likes to these posts!
Your question got successfully answered? Then just click on the 'Mark as solution' button.


Thomas Stühle
Technical Support Specialist
0 Likes
Message 5 of 8

cnaan123
Participant
Participant

Please note that I have a lot of experience, I have been working in this environment for the last 15 years. I tried all possible ways. I am working with Map2018 + 2020 versions and in both a NULL result is obtained

0 Likes
Message 6 of 8

Thomas_Stuehle
Alumni
Alumni
Accepted solution

Hello @cnaan123 

 

I reproduced on my side with an individual text string and did the following calculation on it:

 

ToDate ( Substr ( DATUM , 1, 10 ), 'DD.MM.YYY' )

 

Please check if it also works on your side - using "." instead of "/". Afterwards it was recognized as an Date Field and calculations like AddMonths ( Calculation3 , 1 )  gave correct results.

 

DATUM is a Datum String.

 

date_string.png

 

Could the information provided help you and answer your question?

 

If yes, please click on the "Accept as Solution" button as then also other community users can easily find and benefit from the information. If not please dont hesitate to give an update here in your topic so all members know what´s the progression on your question is and can suggest next steps that might be helpful for you to achieve what you´re looking for. 

 

Best regards,

Thomas

 

 

-----------------------------
You found a post helpful? Then feel free to give likes to these posts!
Your question got successfully answered? Then just click on the 'Mark as solution' button.


Thomas Stühle
Technical Support Specialist
0 Likes
Message 7 of 8

cnaan123
Participant
Participant

I think U'r on something. If I Change  The CalcFunction  @2 ToDate ( Substr ( DATE_UPDATE , 1, 10 ), 'DD/MM/YY' ) .

I get the right result/// It might have soemthing 2 do with the Computer date stracture. Could u fined our more about this, It could be helpfule.

0 Likes
Message 8 of 8

Thomas_Stuehle
Alumni
Alumni
Accepted solution

Hello @cnaan123 

 

Great - I am happy that it works on your side now.

 

When I compare the first mentioned string (not working on your side) and the second mentioned string (working on your side), they look very similar except looking at single "spaces" in between.

 

[...]

If I Change  The CalcFunction  @2 ToDate ( Substr ( DATE_UPDATE , 1, 10 ), 'DD/MM/YY' ) .

I get the right result/// It might have soemthing 2 do with the Computer date stracture. Could u fined our more about this, It could be helpfule.


I would need further clarification on this to move forward.

 

If further action is not needed and if my post helped to solve the issue, please click on the "Accept as Solution" button as then also other community users can easily find and benefit from the information. If not please dont hesitate to give an update here in your topic so all members know what´s the progression on your question is and can suggest next steps that might be helpful for you to achieve what you´re looking for.

 

Best regards,

Thomas

-----------------------------
You found a post helpful? Then feel free to give likes to these posts!
Your question got successfully answered? Then just click on the 'Mark as solution' button.


Thomas Stühle
Technical Support Specialist
0 Likes