Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is wrong?
Message
From
29/05/2005 07:07:43
 
General information
Forum:
Visual FoxPro
Category:
FRX2Any
Title:
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01018429
Message ID:
01018437
Views:
8
Hello,

using SUM in combination with IIF maybe easier:
lnYear = yearfromsomewhere

SELECT DISTINCT dl.date, ;
                dl.code, ;
                dl.category, ;
                SUM(IIF(ca.category="H",1,0)) AS CntCatH, ;
                SUM(IIF(ca.category="B",1,0)) AS CntCatB, ;
FROM dlyatten dl LEFT JOIN (alias11) ca ON dl.date = ca.date ;
WHERE YEAR(dl.date) = lnYear ;
INTO CURSOR temp
(to Khalid)
not tested, and may give you wrong results .. i don't know your data structures .. but i think you'll get the idea ..


Regards
Christian
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform