Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Counting header records
Message
From
22/08/2003 16:23:24
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00822738
Message ID:
00822748
Views:
14
nop. the new field 'ordercnt' shows the same count as 'oecount', which is actually is the line item count from codet.

i think it has to do with the creation of the querry. since the sql looks at all the detail items (since they are connected to the header), it 'creates' n times the header record for each detail item.

i was think that maybe i need to create a subquerry in order to achive this. but i have no clue on how or where to start.


>Is this what you need?
>
>
>sele ;
> sum(b.usell*b.qtyord) as sales, ;
> count(a.oeno) as oecount, ;
>count(*) as ordercnt,;
>month(a.reqdate) as nmonth ;
> from comast a, codet b ;
> where ;
> a.oeno = b.oeno .and. ;
> "100" $ a.custclass .and. ;
> between(a.reqdate, {^2003/01/01}, {^2003/12/31}) ;
> group by nmonth
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform