Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select 2 division or more
Message
From
18/07/2005 01:37:52
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Select 2 division or more
Environment versions
Visual FoxPro:
VFP 8
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01033431
Message ID:
01033431
Views:
53
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
Next
Reply
Map
View

Click here to load this message in the networking platform