try this: select sum(physical_mb)-(select sum(physical_mb) from occupancy where stgpool_name='COPYLTO1_WIN') from occupancy where stgpool_name ='TAPELTO1_WIN'
PAC Brion Arnaud <Arnaud.Brion@PAN To: [EMAIL PROTECTED] ALPINA.COM> cc: Sent by: "ADSM: Subject: SQL problem .... Dist Stor Manager" <[EMAIL PROTECTED] .EDU> 07.02.2003 10:42 Please respond to "ADSM: Dist Stor Manager" Hi list, Could any SQL genius explain me wat is wrong with this statement : select sum(physical_mb) from occupancy where stgpool_name='TAPELTO1_WIN' - (select sum(physical_mb) from occupancy where stgpool_name='COPYLTO1_WIN' ) When trying to use it II get following output : ANR2916E The SQL data types CHAR(12) and DECIMAL(31,2) are incompatible for operator '-'. I already tried to add "dec()" on both selects without achieving any valuable result ... is it a bug or do I need additional coffee to wake up my mind ? What I'm trying to achieve is to calculate the remaining amount of data to copy before a backup stgpool process finishes. Thanks in advance ! Cheers. Arnaud =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= | Arnaud Brion, Panalpina Management Ltd., IT Group | | Viaduktstrasse 42, P.O. Box, 4002 Basel - Switzerland | | Phone: +41 61 226 19 78 / Fax: +41 61 226 17 01 | =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=