Getting the sql for a query ran

Does anyone know how to get the query of a search ran so I can use it in a summary page to get the count of summarized records?
Usually if you turn on debug it is at the top of the screen

looks like this:

(mysqlt): select count(*), sum(cld_orders) as sum_cld_orders, sum(cld_shipped) as sum_cld_shipped, sum(cld_backorder) as sum_cld_backorder, sum(cld_total) as sum_cld_total from testtable where user_id = ‘123’ and order_date between ‘2016-08-01’ and ‘2017-07-31’

I would think that is a variable somewhere but can determine which one…

Kevin

$this->Ini->Db->_driver->_stmt->queryString

tried throwing that into the header and the on record,
this is a summarized grid report so I didnt get anything on the summary screen but when I went into the detail I got errors on record:

Undefined property: ADODB_mysqlt::$_drive
Trying to get property of non-object

all i did was have it echo out that variable…

echo 'query string is '.$this->Ini->Db->_driver->_stmt->queryString;

any ideas?

Kev

No idea. I just tried in the onHeader of a grid and it works, but that was a plain grid (no summary)

Yea I just tried in a regular grid,
must not be available in my version…

Surprising cause they dont change code at all unless they have to…

kev