Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multiple sums in one select
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Multiple sums in one select
Miscellaneous
Thread ID:
00612819
Message ID:
00612819
Views:
66
I'm build a cursor to use for a report and need to repeat the same sum() many times. Is there a way to resuse a calculated field again?

This is an example, but I have to create hours and ratios for a dozen different time types:
Select sum(ts.nHours) as totalHours, ;
	Sum(IIF(ts.fk_timetype_id = 1, 1, 0)) As woHours, ;
        ** The following is repeating the totalHours and woHours sums
        ** is there a way resuse those calculated columns?
	Sum(IIF(ts.fk_timetype_id = 1, 1, 0)) / (sum(ts.nHours) / 100) As woRatio
TIA
Roi
'MCP' Visual FoxPro

In Rome, there was a poem.
About a dog, who found two bone.
He lick the one, he lick the other.
He went pyscho, he drop dead!
Next
Reply
Map
View

Click here to load this message in the networking platform