|
Steve, thank you for pointing me to this bug. We'll fix it in the next update. Hmm well I don't know which bug you were referring to, but I will post just once more asking for help with the query issue, as I am totally stumped with that one. I created a page with a single report, and the only changes made to that report was changing the query. This is the query -
SELECT TOP (100) PERCENT dbo.v_ProdTbl_Durations.ProdDate,
dbo.v_ProdTbl_Durations.ShiftID,
DATEPART(HOUR, dbo.v_ProdTbl_Durations.LocalTime) AS LocalHour,
DATEPART(HOUR, dbo.v_ProdTbl_Durations.StartTime) AS UTCHour,
dbo.StatEventKeyTbl.EventDesc,
SUM(dbo.v_ProdTbl_Durations.DurSec) AS DurSec,
(CASE IJ.InDurSec WHEN 0 THEN 0 ELSE (CAST(SUM(dbo.v_ProdTbl_Durations.DurSec) AS FLOAT)/CAST(IJ.InDurSec AS FLOAT))*100 END) AS [Percent]
FROM dbo.v_ProdTbl_Durations INNER JOIN
(SELECT DATEPART(HOUR,StartTime) AS InUTCHour, ProdDate AS InProdDate, DATEPART(HOUR,LocalTime) AS InLocalHour, SUM(DurSec) AS InDurSec
FROM dbo.v_ProdTbl_Durations AS v_ProdTbl_Durations_1
GROUP BY DATEPART(HOUR,StartTime), DATEPART(HOUR,LocalTime), ProdDate) AS IJ ON dbo.v_ProdTbl_Durations.ProdDate = IJ.InProdDate AND DATEPART(HOUR, dbo.v_ProdTbl_Durations.StartTime) = IJ.InUTCHour AND
DATEPART(HOUR, dbo.v_ProdTbl_Durations.LocalTime) = IJ.InLocalHour
INNER JOIN dbo.StatEventKeyTbl ON dbo.v_ProdTbl_Durations.Status = dbo.StatEventKeyTbl.Event
GROUP BY
dbo.v_ProdTbl_Durations.ProdDate,
dbo.v_ProdTbl_Durations.ShiftID,
DATEPART(HOUR, dbo.v_ProdTbl_Durations.StartTime),
DATEPART(HOUR, dbo.v_ProdTbl_Durations.LocalTime),
dbo.StatEventKeyTbl.EventDesc,
IJ.InDurSec
HAVING
SUM(DurSec)>0
ORDER BY
dbo.v_ProdTbl_Durations.ProdDate DESC,
dbo.v_ProdTbl_Durations.ShiftID DESC,
DATEPART(HOUR, dbo.v_ProdTbl_Durations.LocalTime) DESC
Which works fine in the PHPRunner "veiw your sql" tab, fine as a query to my database, but orders everything as JUST ascending when looking at the website. I am not opposed to going into the reportlib and changing this manually, since obviously something is going wrong with how PHPRunner is assigning things to the template. As I have said changes in the variables file have no effect. EDIT-
a few other notes for clarity
- I have other querys on other pages just as complicated as this, selecting from tables made in the query, which do work.
-It works fine in 5.0
|