Cannot perform '=' operation on System.DateTime and System.String


#1

MOOP Calculator has thrown an exceptionSource: AssignMessage: Cannot perform ‘=’ operation on System.DateTime and System.String.Exception Type: EvaluateExceptionSystem.Data.EvaluateException: Cannot perform ‘=’ operation on System.DateTime and System.String.at System.Data.BinaryNode.SetTypeMismatchError(Int32 op, Type left, Type right)at System.Data.BinaryNode.BinaryCompare(Object vLeft, Object vRight, StorageType resultType, Int32 op, CompareInfo comparer)at System.Data.BinaryNode.EvalBinaryOp(Int32 op, ExpressionNode left, ExpressionNode right, DataRow row, DataRowVersion version, Int32[] recordNos)at System.Data.BinaryNode.Eval(DataRow row, DataRowVersion version)at System.Data.BinaryNode.Eval(ExpressionNode expr, DataRow row, DataRowVersion version, Int32[] recordNos)at System.Data.BinaryNode.EvalBinaryOp(Int32 op, ExpressionNode left, ExpressionNode right, DataRow row, DataRowVersion version, Int32[] recordNos)at System.Data.BinaryNode.Eval(DataRow row, DataRowVersion version)at System.Data.Select.AcceptRecord(Int32 record)at System.Data.Select.GetLinearFilteredRows(Range range)at System.Data.Select.SelectRows()at System.Data.DataTable.Select(String filterExpression)at lambda_method(Closure , ActivityContext )at Microsoft.VisualBasic.Activities.VisualBasicValue1.Execute(CodeActivityContext context)at System.Activities.CodeActivity1.InternalExecuteInResolutionContext(CodeActivityContext context)at System.Activities.Runtime.ActivityExecutor.ExecuteInResolutionContext[T](ActivityInstance parentInstance, Activity1 expressionActivity)at System.Activities.InArgument1.TryPopulateValue(LocationEnvironment targetEnvironment, ActivityInstance activityInstance, ActivityExecutor executor)at System.Activities.RuntimeArgument.TryPopulateValue(LocationEnvironment targetEnvironment, ActivityInstance targetActivityInstance, ActivityExecutor executor, Object argumentValueOverride, Location resultLocation, Boolean skipFastPath)at System.Activities.ActivityInstance.InternalTryPopulateArgumentValueOrScheduleExpression(RuntimeArgument argument, Int32 nextArgumentIndex, ActivityExecutor executor, IDictionary2 argumentValueOverrides, Location resultLocation, Boolean isDynamicUpdate)at System.Activities.ActivityInstance.ResolveArguments(ActivityExecutor executor, IDictionary2 argumentValueOverrides, Location resultLocation, Int32 startIndex)at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)


#2

Hello @j_indu,

Convert the DateTime variable to string first with .ToString!


#3

Or parse the string into a date format
Date.ParseExact(dateString, format)