General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only