Hi everyone!
First time posting on the forum for me.
I’m working on an automation that requires me to convert a date as a String variable taken from a DataTable into a DateTime Variable, to later calculate and see if 14 days have passed since that date.
The problem I’m encountering is that I can’t in any way make the DateTime.ParseExact function work.
The start date gets pulled from the datatable in the format “MM/dd/yyyy HH:mm:ss” and gets sanitized via RegEx to only output the “MM/dd/yyyy” part.
strAssignmentDate = System.Text.RegularExpressions.Regex.Match(CurrentRow.Item(“DATAINC”).ToString, “(0[1-9]|1[012])- /.- /.\d\d”).ToString
Then I made an Assign activity which contains:
dtimeAssignmentDate = DateTime.ParseExact(“strAssignmentDate”, “MM/dd/yyyy”, System.Globalization.CultureInfo.InvariantCulture)
But it always gives me the error (yes, even if I leave strAssignmentDate as “MM/dd/yyyy HH:mm:ss”)
Assignemt Date: 01/08/2024
Multiple Assign: Can not assign ‘DateTime.ParseExact(“strAssignmentDate”, “MM/dd/yyyy”, System.Globalization.CultureInfo.InvariantCulture)’ to ‘dtimeAssignmentDate’.
A fatal error has occurred. Data couldn’t be processed.
Workflow | Main - DataProcess | ended with 1 errors.
Everything is in a For Each DT Row



