You are viewing limited content. For full access, please sign in.

Question

Question

Invalid cast from 'Int32' to 'DateTime' Error

asked on October 5, 2017

I have the below workflow that checks documents for expiration by first establishing a set of "Date Token Calculator Variables" with both one month away from today and 2 months away from today values.  I then use a Condition to compare and determine if the document in question falls within that expiring zone.  All seems to work fine, but I get the "Invalid cast from 'Int32' to 'DateTime'" Errors when it is processed. 

The Date Token Calculator technically add and Int to a date time, but I don't see how I'm messing it up. Any suggestions on what I've done wrong?  Seeing all the red errors drives me nuts.

 

Thanks in advance

 

 

WF 10.2

 

0 0

Answer

SELECTED ANSWER
replied on October 6, 2017 Show version history

I was so optimistic with your suggestion.  Didn't work. Upon further examination, these were documents that did not have a date entered into the field.  So it was taking the null as "0" and comparing it against the date. Thanks for the direction, I am keeping your suggestion in the WF.  And adding a if it does not equal 0.

 

Yeah!!! 

 

EDIT:  I did have to drop the Expiration date into a string token so the comparison to 0 didn't introduce the same issue.

0 0

Replies

replied on October 5, 2017

Try parsing the Expiry date to a token and set the token tag to Date and use that in the comparison.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.