โ12-05-2018 12:32 PM
Hi everyone,
Iโve been trying to convert data Iโm receiving from a varchar (20171211 125023) into a datetime (2017-12-11 12:50:23). Iโve been messing with the mapper but I feel like Iโm at a road block now. I was wondering if someone in the community has any success in this.
โ12-06-2018 06:30 AM
When I insert my schema this is what I get.
Could not compile expression: Date.parse($MODDATE,โyyyyMMdd โฆ (Reason: Invalid token: โโโ for expression: Date.parse($MODDATE,โyyyyMMdd โฆ; Resolution: Please check expression syntax)
โ12-06-2018 06:45 AM
Can you give me the complete expression you are providing and the error as well.
โ12-06-2018 06:50 AM
Of course,
expression:
Date.parse($MODDATE,โyyyyMMdd hhmmssโ).toLocaleDateTimeString({โformatโ:โyyyy-MM-dd hh:mm:ssโ})
Validation errors:
property_map.settings.transformations.value.mappingTable.value[2].expression.value: Could not compile expression: Date.parse($MODDATE,โyyyyMMdd โฆ (Reason: Invalid token: โโโ for expression: Date.parse($MODDATE,โyyyyMMdd โฆ; Resolution: Please check expression syntax)
โ12-06-2018 06:58 AM
Matt,
If you copy the expression from here, it will have different quotations (" "). Try to type the entire expression in the mapper instead of copying it from here. It works.
โ12-06-2018 07:03 AM
The quote thing messed me up when I was trying to help someone with an expression on a different thread. If you wrap the expression in preformatted text using , then it wonโt change the quote mark.
For example I think this should copy and paste ok:
Date.parse($MODDATE,"yyyyMMdd hhmmss").toLocaleDateTimeString({"format":"yyyy-MM-dd hh:mm:ss"})