Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CR-XI using MySQL: group by not working for timestamp

Status
Not open for further replies.

smzafar

MIS
Jan 16, 2007
3
US
I am trying to get the max(timestamp) and min(timestamp) for every grouped data but it is only showing the max and min for the whole table. The following SQL works fine in PHPMyAdmin using MySQL, however I need to get the same results using CR-XI.

MySQL:
Code:
select file_id, max(timestamp), min(timestamp) 
from 360_status_log 
group by file_id 
order by file_id
 
Paste the SQL into the Add Command listed below your MySQL data source.

Otherwise you can just connect to the table, and group by the file_id, and then in the report->selection formula->group place:

{table.timestamp} = maximum({table.timestamp},{table.fileid})
or
{table.timestamp} = minimum({table.timestamp},{table.fileid})

This will suppress the other values.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top