Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Reuse calculated columns
Wed, Feb 3 2010 2:05 PMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Its probably in the stack somewhere but if it isn't please add. Starting work on working out LOB slack I have two queries so far


SELECT
CEIL(Length(_Encoded)/ 512) AS Blocks,
Length(_Encoded) AS Bytes,
(CEIL(Length(_Encoded)/ 512) * 512) AS Required,
Length(_Encoded) - (CEIL(Length(_Encoded)/ 512) * 512) AS Slack,
TRUNC(10000 *(Length(_Encoded) - (CEIL(Length(_Encoded)/ 512) * 512)) / Length(_Encoded)) / 100 AS Percentage
FROM EMails

SELECT
SUM(CEIL(Length(_Encoded)/ 4096)) AS Blocks,
SUM(Length(_Encoded)) AS Bytes,
(SUM(CEIL(Length(_Encoded)/ 4096)) * 4096) AS Required,
SUM(Length(_Encoded)) - SUM((CEIL(Length(_Encoded)/ 4096)) * 4096) AS Slack,
TRUNC(10000 *(SUM(Length(_Encoded)) - (SUM(CEIL(Length(_Encoded)/ 4096)) * 4096)) / SUM(Length(_Encoded))) / 100 AS Percentage
FROM EMails

It would be so nice not to have to type the calculation again, and again, and again

Roy Lambert
Thu, Feb 4 2010 9:30 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< Its probably in the stack somewhere but if it isn't please add. Starting
work on working out LOB slack I have two queries so far >>

Functions are your friend. Smiley

I'll see what I can do...

--
Tim Young
Elevate Software
www.elevatesoft.com

Thu, Feb 4 2010 10:08 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim

>Functions are your friend. Smiley

I thought of that, but if I can ever get it off the ground it will be a utility to be applied to any database so I don't want to have to go and functions into each one I want to check out.

Roy Lambert
Image