Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is wrong?
Message
 
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:
01018433
Views:
9
>yes this is wrong thread,by mistake.
>Boris if want more than one count how i will get

More SELECTs.
** I hate use pseudonims (or whatever they are called) in SELECTs. They make hard to read code. 
** I use them only when I don't have a choise i.e. when i want a multiple SELECTs from one table

** I use you code just to make an example. If this code doesn't returns what you want just do as I said in previuos message.
** I just notice that COUNT() function is wrong. You must put the condition in WHERE clause
 
m.nWhatedYear = thisform.text1.Value

SELECT DISTINCT dlyatten.date,;
                dlyatten.code,;
                dlyatten.category,;
                (SELECT COUNT(*) FROM (alias11) CatH WHERE dlyatten.date = CatH.date .and. year(CatH.date)=m.nWhatedYear AND CatH.category="H") AS CntCatH,;
                (SELECT COUNT(*) FROM (alias11) CatB WHERE dlyatten.date = CatB.date .and. year(CatB.date)=m.nWhatedYear AND CatB.category="B") AS CntCatB;
FROM dlyatten;
INTO CURSOR temp
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform