Skip to Content
0

Need Last RunDate for Queries

Aug 30, 2017 at 03:42 PM

33

avatar image
Former Member

Hello - I am trying to reduce the number of open queries I have in SAP B1. Trying to create a query/report that shows Last RUN DATE of the queries from OUQR but the Date is NULL. How can I get the last RUN date for all queries

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

avatar image
Former Member Aug 31, 2017 at 10:17 AM
0

Hi Daniel,

Basically its works as per standard design, but if you required to update the Last Run date time then you have to modified your queries.

Please find the below format.

Lets you have one query For example query

SELECT Top 5 DocDate,DocNum,CardName,DocTotal from OINV order by Doctotal desc

I used this query:

DECLARE @UserQuery nvarchar(max) = 'SELECT Top 5 DocDate,DocNum,CardName,DocTotal from OINV order by Doctotal desc'

EXEC sp_executesql @UserQuery

UPDATE OUQR SET QLastDate = GetDate() where cast(QString as nvarchar(max)) like '%'+@UserQuery +'%'

When user executed query In OUQR table field QLastDate will be updated.

Its Hope helpful answer.

Rgds,

Kamlesh Naware

Share
10 |10000 characters needed characters left characters exceeded