ADSM-L

SQL Select statement help

2004-08-31 11:52:39
Subject: SQL Select statement help
From: "Warren, Matthew (Retail)" <Matthew.Warren AT POWERGEN.CO DOT UK>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Tue, 31 Aug 2004 15:51:28 +0100
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

<Prev in Thread] Current Thread [Next in Thread>