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

Question

Question

Date as input in a query

asked on October 13, 2015

Hi,

Im trying to obtain the week number (1,2,3,4 or 5) of the month given a date ( Ex. 2015-10-01 will be week 1).

I have this simple query that works fine in SQL server and in workflow.

However, if I use a token for the date:

And use the following in the WF:

I get the following error:

 

Dont know if there is something Im missing or why is the error managing dates.

 

Thanks in advance.

0 0

Replies

replied on October 13, 2015

What if you change the type in the Custom Query Editor from "default" to "DateTime"?

0 0
replied on October 13, 2015

Hi Miruna, 

Thanks for the answer

Already tried to match Both the token and the parameter names type, to "Date", "DateTime", "Default" and "String". Getting the same error.

 

0 0
replied on October 13, 2015

It works for me, so I'd suggest that you double-check the date format for the Workflow Server.

That said, calling into SQL for basic calculation is going to be inefficient under load. I'd suggest replacing it with a script.

0 0
replied on March 10, 2016

Were you able to solve this?  Getting the same error when doing a custom query and inserting the date into a datetime field in SQL.

0 0
replied on March 10, 2016

Hi Kyle,

My problem was solved, I used the "string" type in the token. When I received the error was in the test mode, however If I tried running the workflow it worked.

Have you tried that?

 

0 0
replied on March 10, 2016

After so many fails running the WF, I've just been doing the test and getting errors.  Yes, upon running the WF in its entirety, it works fine.  Brain gets stuck going in one path sometimes...

 

Thanks

0 0
replied on March 10, 2016

Happened to me several times.... Glad that is working now...

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

Sign in to reply to this post.