Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Desk Order & Delivery Order Module
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Desk Order & Delivery Order Module

 Post Reply Post Reply
Author
ngaisteve1 View Drop Down
Groupie
Groupie
Avatar

Joined: 26 December 2002
Location: Malaysia
Status: Offline
Points: 169
Post Options Post Options   Thanks (0) Thanks(0)   Quote ngaisteve1 Quote  Post ReplyReply Direct Link To This Post Topic: Desk Order & Delivery Order Module
    Posted: 17 February 2004 at 10:23pm
I'm currently developing a system which consist of desk order module and delivery order module. Desk order is about how many quantity of item customer order while delivery order is quantity of item delivered to the customer. one desk order might have one or more delivery order. eg, if customer order 20 pieces. it can be 2 delivery order, 10 each.

I have done all the insert part. The problem I face is, the syntax to total up all item of delivery order details to desk order details. Ok, fyi, I have 4 tables: desk_order (DK), desk_order_details (DKD), delivery_order (DO), delivery_order_details (DOD).

DK: DK_ID (Primary Key), DK_No
DKD: DKD_ID (Primary Key), DK_ID (Foreign Key), Qty_Ordered, Qty_Out
DO: DO_ID (Primary Key), DK_ID (Foreign Key), DO_No
DOD: DOD_ID (Primary Key), DO_ID (Foreign Key), DKD_ID (Foreign Key), Qty_Delivered

Eg
DKD
DKD_ID | DK_ID | Qty_Ordered | Qty_Out
1 | 001 | 4 | ???
2 | 001 | 20 | ???

DOD
DOD_ID | DKD_ID | Qty_Delivered
111 | 1 | 4
112 | 2 | 10
113 | 2 | 10

What I am doing is to find ???, which is Qty_Out. So, the code I have is


sql = "SELECT SUM(qty_delivered) as qty_delivered, qty_out FROM delivery_order_details as dod, delivery_order as do"
sql = sql & " WHERE dod.desk_order_id = do.desk_order_id"
sql = sql & " GROUP BY dod.desk_order_id "
rs2.Open sql, conn, 3, 3
if not rs2.eof then
	do while not rs2.eof
		rs2("qty_out") =  rs2("qty_delivered")
		rs2.update
		rs2.movenext
	loop
e nd if


But when I run it, got error saying:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E21)
ODBC driver does not support the requested properties.

Just hope someone can help me to fix this. Thanks.
Back to Top
ngaisteve1 View Drop Down
Groupie
Groupie
Avatar

Joined: 26 December 2002
Location: Malaysia
Status: Offline
Points: 169
Post Options Post Options   Thanks (0) Thanks(0)   Quote ngaisteve1 Quote  Post ReplyReply Direct Link To This Post Posted: 18 February 2004 at 2:23am
Ok now, I have changed it to

sql = "UPDATE desk_order_details as dkd INNER JOIN delivery_order_details as dod"
sql = sql & " ON dod.desk_order_details_id = dkd.desk_order_details_id "
sql = sql & " SET qty_out = SUM(dod.qty_delivered)"

conn.Execute sql
conn.Close

But, then got error saying:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[MySQL][ODBC 3.51 Driver][mysqld-4.0.16-nt]Invalid use of group function
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.