Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select 2 division or more
Message
De
18/07/2005 01:37:52
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Select 2 division or more
Versions des environnements
Visual FoxPro:
VFP 8
Database:
Visual FoxPro
Divers
Thread ID:
01033431
Message ID:
01033431
Vues:
52
hi all,
could you help me to get results for 2 divisions or more via division name as under
 divi="تعبئة/كوابل" AND divi="تلبيس/كوابل"  AND....... ;
SET TALK OFF
SET ECHO OFF
SET SAFETY off
CLOSE all
USE table1
m.dat1=DATE(2005,1,1)
m.dat2=DATE(2005,12,31)

SELECT divi, mac1, ;
SUM(IIF(MONTH(dat)=1  AND typ = 1, INT(CTOT(true) -CTOT("00:00")), 000000)) AS m1_m, ;
SUM(IIF(MONTH(dat)=1  AND typ = 2, INT(CTOT(true) -CTOT("00:00")), 000000)) AS m1_a, ;          
SUM(IIF(MONTH(dat)=1  AND typ <= 2, INT(CTOT(true) -CTOT("00:00")), 000000)) AS m1_t, ;
SUM(IIF(MONTH(dat)=2  AND typ = 1, INT(CTOT(true) -CTOT("00:00")), 000000)) AS m2_m, ;
SUM(IIF(MONTH(dat)=2  AND typ = 2, INT(CTOT(true) -CTOT("00:00")), 000000)) AS m2_a, ;          
SUM(IIF(MONTH(dat)=2  AND typ <= 2, INT(CTOT(true) -CTOT("00:00")), 000000)) AS m2_t, ;
SUM(IIF(MONTH(dat)=3  AND typ = 1, INT(CTOT(true) -CTOT("00:00")), 000000)) AS m3_m, ;
SUM(IIF(MONTH(dat)=3  AND typ = 2, INT(CTOT(true) -CTOT("00:00")), 000000)) AS m3_a, ;         
SUM(IIF(MONTH(dat)=3  AND typ <= 2, INT(CTOT(true) -CTOT("00:00")), 000000)) AS m3_t, ;
SUM(IIF(typ = 1, INT(CTOT(true) - CTOT("00:00")), 000000))                           AS tot_m, ;
SUM(IIF(typ = 2, INT(CTOT(true) - CTOT("00:00")), 000000))                           AS tot_a, ;
SUM(IIF(typ <= 2, INT(CTOT(true) - CTOT("00:00")), 000000))                           AS tot_t, ;
SUM(IIF(typ >= 4, INT(CTOT(true) - CTOT("00:00")), 000000))                           AS tot_tot ;
FROM table1 ;
WHERE dat BETWEEN m.dat1 AND m.dat2  AND divi="&#1578;&#1593;&#1576;&#1574;&#1577;/&#1603;&#1608;&#1575;&#1576;&#1604;" AND divi="&#1578;&#1604;&#1576;&#1610;&#1587;/&#1603;&#1608;&#1575;&#1576;&#1604;"   ;
GROUP BY 1,2;
ORDER BY 1, 2;
INTO table curbilldata
USE curbilldata
BROWSE NORMAL
thanks
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform