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

Question

Question

WF not returning data using Custom Query on the basis of document creation date

asked on July 26, 2016 Show version history

Guys,

I am getting error when trying to run a query for Documents Creation Date.

The query works fine in SQL Management studio, but doens't work in WOrkflow.

 

 

When I Test this query from WF, by passing values '2013-04-6' I get the error.

Error:

 

 

When I tried passing the values directly in the query (like below) :

I get this error:

0 0

Answer

SELECTED ANSWER
replied on July 26, 2016

Yes, it should be just:

created < ?

 

0 0

Replies

replied on July 26, 2016 Show version history

Hi Uzair,

According to technet

{d '2013-04-56'}

However, I'd go one step further and query your desire to use the Workflow ODBC driver. If you use the "Direct MS SQL" driver instead, you can use plain old T-SQL in your Workflow activities and you could use the scripts you've created in SQL Management Studio.

The Workflow service will need to be running with an account that authenticates on the SQL server. I think the Subscriber as well but I always have both running under the same service account.

 

1 0
replied on July 28, 2016

Thanks Ben.

Fortunately, Miruna's suggestion of taking quotes off has worked :)

0 0
replied on July 28, 2016

No worries Uzair :-) Miruna has eagle eyes!

 

0 0
replied on July 26, 2016

What version of WF are you running?  We are running 10.0 and I successfully got a test by using:

Maybe try the type as Default?  Or what is your token in your Parameter value?  Maybe try assigning it a token value and formatting that token?

1 0
replied on July 26, 2016

Yes, it's the extra quotes around the ? that break it.

0 0
replied on July 26, 2016

Does "2013-04-06" work?

0 0
replied on July 26, 2016

No it doesn't. 

But it works fine in sql management studio.

0 0
replied on July 26, 2016

Oh, sorry, missed that you have quotes around the question mark. Take them out, please.

0 0
replied on July 26, 2016 Show version history

Miruna,

Do you mean single quotes? 

I did try that I believe but I will give it another try to make sure. 

0 0
SELECTED ANSWER
replied on July 26, 2016

Yes, it should be just:

created < ?

 

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

Sign in to reply to this post.