ProductCart E-Commerce Solutions Homepage
Forum Home Forum Home > ProductCart > Suggestions
  New Posts New Posts RSS Feed - Average Items Per Order
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Average Items Per Order

 Post Reply Post Reply
Author
Message
MOlson View Drop Down
Newbie
Newbie


Joined: 16-November-2005
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote MOlson Quote  Post ReplyReply Direct Link To This Post Topic: Average Items Per Order
    Posted: 14-February-2007 at 6:14pm

I need a little help with some SQL.  We are registering with shop.org and they are asking for some data on our site.  Could someone help me with the query for:

Average Number of Items Per Order for 2006

Thanks in advance for any help.  I've busted out the old college database books and it scares me.



Edited by MOlson - 14-February-2007 at 6:14pm
Back to Top
MOlson View Drop Down
Newbie
Newbie


Joined: 16-November-2005
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote MOlson Quote  Post ReplyReply Direct Link To This Post Posted: 16-February-2007 at 1:07pm

I think I got it, if anyone sees a problem with this please let me know, just don't tell my Marketing department

SELECT orders.idOrder, SUM(ProductsOrdered.quantity) as "Total Products"

FROM orders INNER JOIN ProductsOrdered ON orders.idOrder = ProductsOrdered.idOrder

WHERE ((orderStatus > 2 AND orderStatus < 5) OR (orderStatus > 6 AND orderStatus < 9)) AND orderDate >= '01/01/2006' AND orderDate <= '12/31/2006'

GROUP BY orders.idOrder

order by orders.idOrder;

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.063 seconds.