Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get percentage(%) with sql command
Message
De
17/09/2005 00:24:37
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01049464
Message ID:
01050550
Vues:
20
This message has been marked as a message which has helped to the initial question of the thread.
Dear

PUBLIC NAME1,OBMARKS,TOTMARKS
STORE SPACE(30) TO NAME1
STORE 0 TO OBMARKS,TOTMARKS

CREATE TABLE Master1 (NAME1 C(10), OBMARKS N(4),TOTMARKS N(4))
INSERT INTO Master1 (NAME1,OBMARKS,TOTMARKS) VALUES ("A",400,850)
INSERT INTO Master1 (NAME1,OBMARKS,TOTMARKS) VALUES ("B",685,850)
INSERT INTO Master1 (NAME1,OBMARKS,TOTMARKS) VALUES ("C",700,850)
INSERT INTO Master1 (NAME1,OBMARKS,TOTMARKS) VALUES ("D",200,850)
INSERT INTO Master1 (NAME1,OBMARKS,TOTMARKS) VALUES ("E",279,850)
INSERT INTO Master1 (NAME1,OBMARKS,TOTMARKS) VALUES ("F",510,850)

Test = "csr" + SYS(2015) && gives you unique cursor name everytime
SELECT *,;
TRANSFORM((OBMARKS/TOTMARKS)*100,"##.##") AS PERCENTAGE;
FROM Master1;
ORDER BY PERCENTAGE DESCENDING;
INTO CURSOR XYZ

SELECT XYZ
BROW

I hope this will help
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform