-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: VinodK [TLabs, SCT]
Message 2 in Discussion
Interesting Saro ... Here is one solution ... But please understand that this is not
the only solution around ... Will update on this as and when I find more solutions ...
/*
Create table Site_Info (IP Varchar(16), HDDsize Varchar(20))
GO
Insert into Site_Info Values ('192.168.1.1', '9.5 GB')
Insert into Site_Info Values ('192.168.1.1', '9.5 MB')
Insert into Site_Info Values ('192.168.1.1', '9.5 Bytes')
Insert into Site_Info Values ('192.168.1.2', '10 GB')
Insert into Site_Info Values ('192.168.1.2', '200 MB')
GO
*/ Select IP,
SUM(Case [Capacity]
When 'GB' Then Cast(Size as decimal(38,3)) * 1000000
When 'MB' Then Cast(Size as decimal(38,3)) * 1000
When 'Bytes' Then Cast(Size as decimal(38,3))
End) Bytes
>From (
Select IP, Replace(HDDSize,'GB','') Size, 'GB' [Capacity] from site_info Where
HDDSize Like '%GB'
Union ALL
Select IP, Replace(HDDSize,'MB',''),'MB' [Capacity] from site_info Where HDDSize Like
'%MB'
UNION ALL
Select IP, Replace(HDDSize,'Bytes','') , 'Bytes' [Capacity] from site_info Where
HDDSize Like '%Bytes'
) Derived
Group By IP
HTH, Vinod Kumar
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]