On Jan 4, 2008, at 1:12 PM, Ribeiro, Ricardo wrote:

Hello,
Does anyone has a select statement I can use to find out how many
tapes
I used on a daily basis?
Thanks!

Most commonly, tapes automatically come from the scratches collection
and return to scratch when emptied (rather than being assigned to a
storage pool via DEFine Volume).  And, UPDate Volume is rarely
performed on volumes such that the administrative change timestamp
remains that of when the volume was taken from scratch to be used in
a storage pool.  For basic reporting you can thus employ a variant of
a Select statement like:

select * from volumes where DAYS(CURRENT_DATE)-DAYS(CHG_TIME)<2 and
DATE(LAST_WRITE_DATE)=DATE(CURRENT_TIMESTAMP)

From that point of departure you can play with timestamps for
desired intervals, and further select on STATUS value as desired.

   Richard Sims      http://people.bu.edu/rbs/

Reply via email to