asked 14 hours ago

In this case, converting to numeric.

(But there's a bit of a twist: the table field updates in spite of the activity throwing an error. )

 

I'm calculating days between the date we receive project documents and key milestone project dates, such as project start or construction start.

I'm using a SQL query because I want to know when documents have been received before a milestone date (i.e. DATEDIF would return a negative value) as well as how long after those dates (a positive value). 

 

 

Results:

 

I'm trying to write one of these dates (timeFromConstructionStart) to a SQL table but keep coming up against the data type conversion error, no matter how I adjust the query and/or parameters and values of the workflow activity.

 

Table field data type:

 

 

 

However, as noted at the start, the 'timeFromConstructionStart' field does, in fact, get updated with the correct value:

 

 

I've reviewed several other posts here that touch on this issue, as well as did a lot of troubleshooting, including editing the SQL query to include cast/convert etc., creating tokens formatted as int/number to hold the results of the query (then use the token in the 'update batch item log' activity), and none of it worked. I kept getting the same data type conversion error.

 

It was only when I hard coded the value into an update query activity that the activity completed without throwing an error (no surprise):

 

I know from past experience that values produced from activities such as a custom query are formatted as strings (basically) because I've had issues with that in the past. I'm assuming that's what is going on here. What's frustrating this time is that I can't account for it.

And I don't know why the table is updated correctly anyway, despite the error.

 

Given the amount of time I spent trying to sort this out, I'm fairly sure I'm well past the point of not being able spot what is no doubt some small, simple thing I've set incorrectly or some other thing that I'm unable to spot. So, perhaps some fresh eyes on it will be the thing.

0 0