dUb
04-18-2001, 10:39 AM
I'm trying to take data into a db and then put it in excel but i've got an error. Here's the code:
Set rstORDERED = dbsGEMS.OpenRecordset("SELECT d.num_command, SUM(d.quantity*s.price) total FROM DETAIL_COMMAND d, STOCKCOMMANDS s WHERE d.pec=s.item GROUP BY d.num_command ORDER BY d.num_command;", dbOpenSnapshot, dbReadOnly)
and the error message is:
Run-time error '3075':
Syntax error (missing operator) in query expression
'SUM(d.quantity*s.price) total'.
but this query works perfectly in oracle sql plus
Set rstORDERED = dbsGEMS.OpenRecordset("SELECT d.num_command, SUM(d.quantity*s.price) total FROM DETAIL_COMMAND d, STOCKCOMMANDS s WHERE d.pec=s.item GROUP BY d.num_command ORDER BY d.num_command;", dbOpenSnapshot, dbReadOnly)
and the error message is:
Run-time error '3075':
Syntax error (missing operator) in query expression
'SUM(d.quantity*s.price) total'.
but this query works perfectly in oracle sql plus