Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Multiple sums in one select
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00612819
Message ID:
00612847
Vues:
23
>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!
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform