-
Oracle Date and Time Question
I am wanting to calculate the time between The FirstScan and The LastScan
then divide the time by the total number of traps
And this is the query
select TRAPPER, COUNT(BARCODE) as NOBARCODES, (MIN(to_char(t_date, 'MM-DD-YY HH24:mi:ss'))) as FIRSTSCAN,
(MAX(to_char(t_date, 'MM-DD-YY HH24:mi:ss'))) as LASTSCAN
From forweevil2003.Trapping
WHERE TRAPPER = '429948233'
and t_date between to_date('05/22/03 00:00:00','mm/dd/rr hh24:mi:ss')
and to_date('05/22/03 23:59:59','mm/dd/rr hh24:mi:ss')
GROUP BY TRAPPER
/
TRAPPER NOBARCODES FIRSTSCAN LASTSCAN
--------------- ---------- ----------------- -----------------
429948233 76 05-22-03 08:30:34 05-22-03 13:54:12
Last edited by jayoung; 05-26-2003 at 05:02 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|