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
 
In the Select Expert open the Group Selection Formula Editor and enter:
{Table.TimeStamp} = Maximum({Table.TimeStamp},{Table.File_Id})
or
{Table.TimeStamp} = Minimum({Table.TimeStamp},{Table.File_Id})

Note that the Group Selection only suppresses records that do not meet the group selection criteria. The suppressed records will still be used if you Insert > Summary data, in which case you would want to use running totals.

MrBill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top