Page 1 of 1

Invalid conversion requested from a date to a int64

Posted: Wed Nov 01, 2017 12:36 pm
by mjohnson62982
I am trying to convert a decimal field to a date using the DateFromDaysSince function. The constraint looks like this;
DateFromDaysSince(CFPTA_Con.DSTRTA,'1900-01-01')
I am getting the following error while compiling.
Error in constraint expression for link DSLink4. Invalid conversion requested from a date to a int64.
Any help will be greatly appreciated.

Posted: Wed Nov 01, 2017 12:52 pm
by qt_ky
That function returns a DATE type, whereas a Transformer constraint expression is expected to evaluate to True or False--essentially an integer where zero represents False and 1 or other non-zero numbers represent True.

So, depending on what you're trying to accomplish, if you are indeed using a constraint on one of your output links, as opposed to a column derivation, then you may need to turn your expression into a True/False test, such as DateResultA = CurrentDate() or ThisDate > ThatDate.

Posted: Wed Nov 01, 2017 2:21 pm
by ray.wurlod
You probably need to convert the decimal number to a string, and then that to an integer.

Or look at one of the Julian date functions.

Resolved

Posted: Thu Nov 02, 2017 10:13 am
by mjohnson62982
I resolved this by putting the DateFromDaysSince() function in the Column Derivation field. Thanks for the help everyone.