Using Excel and TSM ODBC I selected the criteria, and here's the sql statement it produces. I had to add devclass criteria as we have some old tapes around.
SELECT VOLUMES.VOLUME_NAME, VOLUMES.STATUS, VOLUMES.PENDING_DATE, VOLUMES.DEVCLASS_NAME FROM VOLUMES VOLUMES WHERE (VOLUMES.DEVCLASS_NAME='3592TAPE') AND (VOLUMES.PENDING_DATE Is Not Null) ORDER BY VOLUMES.PENDING_DATE Results VOLUME_NAME STATUS PENDING_DATE DEVCLASS_NAME U00936 PENDING 8/23/2004 19:21 3592TAPE U00051 PENDING 8/23/2004 19:24 3592TAPE U00203 PENDING 8/23/2004 19:25 3592TAPE U00087 PENDING 8/23/2004 19:27 3592TAPE U00821 PENDING 8/23/2004 19:30 3592TAPE U00031 PENDING 8/23/2004 19:51 3592TAPE U00421 PENDING 8/23/2004 19:51 3592TAPE U00720 PENDING 8/23/2004 19:52 3592TAPE U00943 PENDING 8/23/2004 19:53 3592TAPE -----Original Message----- From: ADSM: Dist Stor Manager [mailto:[EMAIL PROTECTED] Behalf Of Prather, Wanda Sent: Tuesday, August 31, 2004 1:52 PM To: [EMAIL PROTECTED] Subject: Re: SQL Select statement help I hope I'm wrong, but I don't think it's possible to do that. -----Original Message----- From: ADSM: Dist Stor Manager [mailto:[EMAIL PROTECTED] On Behalf Of Warren, Matthew (Retail) Sent: Tuesday, August 31, 2004 10:51 AM To: [EMAIL PROTECTED] Subject: SQL Select statement help Hallo ([I]T/AD)SM'ers Can any wise and clever SQL types help with the following?; I am trying to get TSM to show the number of tapes that went pending by date. I can get this; ANS8000I Server command: 'select cast(pending_date as char(10)),count(*) from volumes where status='PENDING' group by pending_date' Unnamed[1] Unnamed[2] ---------- ----------- 2004-08-27 1 2004-08-27 1 2004-08-27 1 2004-08-28 1 2004-08-28 1 2004-08-28 1 2004-08-28 1 2004-08-28 1 2004-08-29 1 2004-08-29 1 etc.. but what I would like is for the count(*) to be totaling per day. I hoped perhaps the cast() would force this to happen, but it appears the underlying timestamp is still being taken into account. I have tried various other permutations, along the lines of; ANS8000I Server command: 'select cast(pending_date as char(10)) as pending,count(*) from volumes where status='PENDING' group by pending' ANR2940E The reference 'PENDING' is an unknown SQL column name. | ........................................................V...... g,count(*) from volumes where status='PENDING' group by pending but, alas, no joy. I'm wondering if it is actually possible? - I know a little Ksh script that can do it, but I was hoping to achieve it just within TSM - either with a select as I am trying or via some other method. Thanks, Matt. ___________________________ Disclaimer Notice __________________________ This message and any attachments are confidential and should only be read by those to whom they are addressed. If you are not the intended recipient, please contact us, delete the message from your computer and destroy any copies. Any distribution or copying without our prior permission is prohibited. Internet communications are not always secure and therefore Powergen Retail Limited does not accept legal responsibility for this message. The recipient is responsible for verifying its authenticity before acting on the contents. Any views or opinions presented are solely those of the author and do not necessarily represent those of Powergen Retail Limited. Registered addresses: Powergen Retail Limited, Westwood Way, Westwood Business Park, Coventry, CV4 8LG. Registered in England and Wales No: 3407430 Telephone +44 (0) 2476 42 4000 Fax +44 (0) 2476 42 5432