Quantcast
Channel: ADSM.ORG
Viewing all articles
Browse latest Browse all 2470

SQL start_time syntax -2 days and start at 5pm for 24 hours

$
0
0
I found this select to list all activity in the last 24 hours. But I would like it to go back 2 days and start at 5pm for 24 hours. Preferably using -2 to go back two days instead of supplying an actual date. Any help is greatly appreciated. Or point me to the start_time syntax manual. I have been looking. :) Thanks.

SELECT activity, cast(float(sum(bytes))/1024/1024/1024 as dec(8,2)) as "GB" FROM summary -
WHERE activity<>'TAPE MOUNT' AND activity<>'EXPIRATION' -
end_time>current_timestamp-24 hours GROUP BY activity

I want to add a start_time -2 days start at 5pm for 24 hours to this. Or in other words, 5pm to 5pm 2 days ago. And to be a bit more specific, if the current time is after 5pm then go back just one day.

Thanks again.

Viewing all articles
Browse latest Browse all 2470

Trending Articles