Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is it possible in one Select Statement?
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00614551
Message ID:
00614738
Views:
20
Venelina
This works great. Bravo!

Jaime

>Hi, is this what you want to calculate
>
>Select supplier, count(days) as all_records,;
>		sum(Iif(days<=2,1,0)) as count_1_2,;
>		sum(Iif(days<=2,1,0))/count(days)*100 as perc_1_2,;
>		sum(Iif(Between(days, 3, 6),1,0)) as count_3_6,;
>		sum(Iif(Between(days, 3, 6),1,0))/count(days)*100 as perc_3_6,;
>		sum(Iif(days>=7,1,0)) as count_7_more,;
>		sum(Iif(days>=7,1,0))/count(days)*100 as perc_7_more;
>		from test group by supplier
>
>my table is called test, so put there your real table name
Why do programs stop working correctly as soon as you leave the Fox?
Previous
Reply
Map
View

Click here to load this message in the networking platform