Author |
Topic |
|
Renners
Starting Member
United Kingdom
46 Posts |
Posted - May 10 2011 : 04:24:01
|
Hi,
I'm trying to run a query to report sales of products by a specific supplier over a specfic period using the following sql code
SELECT products.ccode, products.cname, products.cstock, COUNT(oitems.numitems) AS [Sold in Period], SUM(oitems.unitprice) AS [Total SV] FROM orders INNER JOIN oitems ON orders.orderid = oitems.orderid INNER JOIN suppliers ON oitems.supplierid = suppliers.supplierid INNER JOIN products ON oitems.catalogid = products.catalogid WHERE (orders.odate > CONVERT(DATETIME, '2010-02-01', 102)) AND (orders.odate < CONVERT(DATETIME, '2011-05-01', 102)) AND (orders.customercancel = 0 OR orders.customercancel IS NULL) AND (orders.canceled = 0) AND (orders.ocardtype <> N'Fail') AND (suppliers.supplierid = 22) GROUP BY products.cstock, products.ccode, products.cname ORDER BY [Total SV] DESC
This runs fine from within MS SQL server studio but will dump me out of the Admin section entirely with an 'An error occured please restart shopping' if I run it via the Query and Export Manager.
Does anyone know if the query and export is a single table query tool?
Regards, Renners
|
|
diegomilito
VP-CART Expert
Argentina
779 Posts |
Posted - May 14 2011 : 05:22:47
|
seems like you cannot use the builtin sql function such as SUM(oitems.unitprice) , COUNT(oitems.numitems), CONVERT(DATETIME, '2011-05-01', 102)) etc...
Diego
|
|
|
support
Administrator
4679 Posts |
|
Renners
Starting Member
United Kingdom
46 Posts |
Posted - August 03 2011 : 10:23:17
|
Hi Cam,
Thanks for the Link, that cured it.
Regards, Renners. |
|
|
|
Topic |
|