cancel
Showing results for 
Search instead for 
Did you mean: 

SBO OQCN QLastDate, QLastTime NULL for all Records - Need to reference last run time

Former Member
0 Kudos

I need to be able to reference the last time queries were used in Business One. From what I have gathered, for that I should reference OUQR. When I view all the data for queries in that table, I noticed that for every record the fields QLastDate and QLastTime are NULL. Why is that? Is there somewhere else I can look to get the last time a query was used? Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member227598
Active Contributor
0 Kudos

Hi Derek,

You can able to search all the query in OUQR table , by below command ...

Select * from OUQR in Query Generator

But Suppose you want more details about the columns details in that table then run  below query in query generator..

SP_Columns 'OuQR'

This Query result explained every details about the fields. you will found QlastDate & QLastTime is set by IS_NULLABLE by SAP default.

I hope it will help for you...

Rgds,

Kamlesh Naware

0 Kudos

Hi Derek,

I had the same problem. I solved it this way:

For example query

SELECT top 10 DocNum, DocDate, CardName, DocTotal from OINV order by DocDate desc

I used this query:

DECLARE @MyQuery nvarchar(max) = 'SELECT top 10 DocNum, DocDate, CardName, DocTotal from OINV order by DocDate desc'

EXEC sp_executesql @MyQuery

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

Then after each execution query, field QLastDate will be updated.

Hope helpful.

Regards,

Krzysztof