Board index » delphi » SQL error - capability not supported...Why ?

SQL error - capability not supported...Why ?

Hi,

The following SQL code gives the above error when I run the query in D1

SELECT DISTINCT D1.PARTNO, D1.DISCRIP, D1.LASTPRICE,
SUM(D.QTY), SUM(D.UNIT_PR*D.QTY), SUM(D.COST_PR)
                ^^^^^^^^^^^^^^^^
FROM "HISTBODY.DBF" D, "PARTS.DBF" D1

WHERE
(D.TYPE = 'STOCK')
 AND (D1.PARTNO = D.PARTNUM)

GROUP BY  D1.PARTNO, D1.DISCRIP, D1.LASTPRICE
ORDER BY  D1.PARTNO, D1.DISCRIP, D1.LASTPRICE

When I omit the multiplication in line 2 it will run but returns me a
result I wasn't looking for.

Any advice most appreciated
Regards, Ian

 

Re:SQL error - capability not supported...Why ?


Quote
IIan Robinson wrote:

> Hi,

> The following SQL code gives the above error when I run the query in D1

> SELECT DISTINCT D1.PARTNO, D1.DISCRIP, D1.LASTPRICE,
> SUM(D.QTY), SUM(D.UNIT_PR*D.QTY), SUM(D.COST_PR)
>                 ^^^^^^^^^^^^^^^^
> FROM "HISTBODY.DBF" D, "PARTS.DBF" D1

> WHERE
> (D.TYPE = 'STOCK')
>  AND (D1.PARTNO = D.PARTNUM)

> GROUP BY  D1.PARTNO, D1.DISCRIP, D1.LASTPRICE
> ORDER BY  D1.PARTNO, D1.DISCRIP, D1.LASTPRICE

> When I omit the multiplication in line 2 it will run but returns me a
> result I wasn't looking for.

> Any advice most appreciated
> Regards, IanI'm not sure which database engine you are using but the sql select

statement does not make sense in Oracle.  You might want to check the
statement.  What exactly do you want to do?

Denis

Re:SQL error - capability not supported...Why ?


In article <33AEF07A....@sympatico.ca>, Paul Surprenant
<psurpren...@sympatico.ca> writes

Quote
>IIan Robinson wrote:

>> Hi,

>> The following SQL code gives the above error when I run the query in D1

>> SELECT DISTINCT D1.PARTNO, D1.DISCRIP, D1.LASTPRICE,
>> SUM(D.QTY), SUM(D.UNIT_PR*D.QTY), SUM(D.COST_PR)
>>                 ^^^^^^^^^^^^^^^^
>> FROM "HISTBODY.DBF" D, "PARTS.DBF" D1

>> WHERE
>> (D.TYPE = 'STOCK')
>>  AND (D1.PARTNO = D.PARTNUM)

>> GROUP BY  D1.PARTNO, D1.DISCRIP, D1.LASTPRICE
>> ORDER BY  D1.PARTNO, D1.DISCRIP, D1.LASTPRICE

>> When I omit the multiplication in line 2 it will run but returns me a
>> result I wasn't looking for.

>> Any advice most appreciated
>> Regards, Ian
>I'm not sure which database engine you are using but the sql
>select statement does not make sense in Oracle.  You might want to

check the statement.  What exactly do you want to do?

Hello Dennis,

I'm using the BDE (Delphi1) and the statement was generated by the
Database desktop 5.1. It works fine without the multiplication part
"SUM(D.UNIT_PR*D.QTY)" and it totals the three fields as planned. The
purpose of the multiplication part is to multiply the 2 fields before
totalling them. The statement does work with Delphi 3 but in Delphi 1 I
get the capability not supported error.

Regards, Ian

Other Threads