Left function is not returning the correct data

Discussion created by meyerge on Jul 24, 2018
Latest reply on Aug 6, 2018 by Stigge

Hey Everyone or Anyone,


I have come across a confusing situation. I downloaded some message tracking data, in a csv format, from my Office 365 exchange server. (The reason I am adding the source of the data is it might provide insight if someone knows of any idiosyncrasies  associated with message tracking logs from Office 365.)


The data was imported in to FileMaker Pro v17. The first field is called the origin_date, but I will just use table:field in this discussion, and is the field I am having issues with. I want to extract the date and the time and put them in their own fields. The origin_date field is configured as a text field. The data looks like this: 2018-07-09T05:50:57.9314196Z.


The command I am using to extract the data is:


Set Variable [$OriginDate ; Value: Left ( table::field; 10)


When I debug the script Watcher shows 2018.


When I use:


Set Variable [$OriginDate ; Value: Left ( GetAsText ( table:field ) ; 10), Watcher shows 2018


If I enter the data directly:


Set Variable [$OriginDate ; Value: Left ( 2018-07-09T05:50:57.9314196Z ; 10),  I get the error message " A number, text constant, field name or "(" is expected here." with the cursor sitting at the position between the ( and 2.


If I put " " around the text" debugger returns 2018.


I even thought there might be something "different " about the data so I typed in the value before running the script and the results were the same.



I am at a loss as to why this is happening and would appreciate any insight in how to resolve this problem.



Thank you for your time.