Hi to everybody,
I'm a newbie to oracle and I've to recreate a query under this new (for me) environment. The query asks for valid results in a specified time related set of intervals into a year, by using the Datepart function:
SELECT *
FROM "Results"
WHERE ID_Measurementplace = 258 AND DATEPART([dw],
ResultTimeStamp) >= 2 AND DATEPART([dw],
ResultTimeStamp) < 7 AND ((DATEPART([hh], resulttimestamp)
= 9 AND DATEPART([n], resulttimestamp) >= 15) OR
DATEPART([hh], resulttimestamp) = 10 OR
(DATEPART([hh], resulttimestamp) = 11 AND DATEPART([n],
resulttimestamp) = 0) OR
(DATEPART([hh], resulttimestamp) = 17 AND DATEPART([n],
resulttimestamp) >= 15) OR
DATEPART([hh], resulttimestamp) = 18 OR
(DATEPART([hh], resulttimestamp) = 19 AND DATEPART([n],
resulttimestamp) = 0)) AND
ResultTimeStamp > '2002-11-01 00:00:00' AND
ResultTimeStamp <= '2002-12-01 00:00:00'
ORDER BY ResultTimeStamp
As far as I've tried, the query won't work under Oracle, and I still cannot figure out a equivalent of datepart under Oracle. Any suggestion would be *so* appreciated.
Tank you in advance.
Max.
I'm a newbie to oracle and I've to recreate a query under this new (for me) environment. The query asks for valid results in a specified time related set of intervals into a year, by using the Datepart function:
SELECT *
FROM "Results"
WHERE ID_Measurementplace = 258 AND DATEPART([dw],
ResultTimeStamp) >= 2 AND DATEPART([dw],
ResultTimeStamp) < 7 AND ((DATEPART([hh], resulttimestamp)
= 9 AND DATEPART([n], resulttimestamp) >= 15) OR
DATEPART([hh], resulttimestamp) = 10 OR
(DATEPART([hh], resulttimestamp) = 11 AND DATEPART([n],
resulttimestamp) = 0) OR
(DATEPART([hh], resulttimestamp) = 17 AND DATEPART([n],
resulttimestamp) >= 15) OR
DATEPART([hh], resulttimestamp) = 18 OR
(DATEPART([hh], resulttimestamp) = 19 AND DATEPART([n],
resulttimestamp) = 0)) AND
ResultTimeStamp > '2002-11-01 00:00:00' AND
ResultTimeStamp <= '2002-12-01 00:00:00'
ORDER BY ResultTimeStamp
As far as I've tried, the query won't work under Oracle, and I still cannot figure out a equivalent of datepart under Oracle. Any suggestion would be *so* appreciated.
Tank you in advance.
Max.