Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multiple sums in one select
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00612819
Message ID:
00612847
Views:
21
>I would split it in two selects. The first calculates woHours and totalHours and the second uses calculated values.

Like this. Cool. Thanks Sergey
Select sum(ts.nHours) as totalHours, ;
	Sum(IIF(ts.fk_timetype_id = 1, 1, 0)) As woHours, ;
        from timeSheest ts
        into cursor rsHours

Select *, ;
	(woHours / totalHours) * 100 as woRatio ;
	from rsHours
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!
Previous
Reply
Map
View

Click here to load this message in the networking platform