ADSM-L

Re: SQL Select statement help

2004-08-31 14:50:54
Subject: Re: SQL Select statement help
From: "Prather, Wanda" <Wanda.Prather AT JHUAPL DOT EDU>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Tue, 31 Aug 2004 14:52:13 -0400
I hope I'm wrong, but I don't think it's possible to do that.


-----Original Message-----
From: ADSM: Dist Stor Manager [mailto:ADSM-L AT VM.MARIST DOT EDU] On Behalf Of
Warren, Matthew (Retail)
Sent: Tuesday, August 31, 2004 10:51 AM
To: ADSM-L AT VM.MARIST DOT EDU
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

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