![]() |
CatSalesReport.asp not showing customer name |
Post Reply ![]() |
Author | |
Brett ![]() Groupie ![]() ![]() Joined: 22-April-2008 Location: Phoenix, AZ Status: Offline Points: 89 |
![]() ![]() ![]() ![]() ![]() Posted: 31-October-2010 at 9:01pm |
The report does not show customer name. Verified on ProductCart demo store.
To fix, edit the query on line 145 (v4.1 PPE): query="SELECT DISTINCT orders.idorder,orders.idcustomer,orders.total,orders.shipmentDetails,orders.paymentDetails,orders.taxAmount,orders.discountDetails,orders.orderDate,orders.processDate,orders.shipDate,customers.name,customers.lastName FROM ((ProductsOrdered INNER JOIN Orders ON ProductsOrdered.idOrder=Orders.idOrder) INNER JOIN customers on customers.idcustomer=orders.idcustomer) INNER JOIN Categories_Products ON ProductsOrdered.idProduct=Categories_Products.idProduct WHERE Categories_Products.IDCategory=" & pIDCategory & " AND ((orders.orderStatus>2 AND orders.orderStatus<5) OR (orders.orderStatus>6 AND orders.orderStatus<9) OR (orders.orderStatus=10 OR orders.orderStatus=12)) " & TempSQL1 & TempSQL2 & TempSpecial & " ORDER BY " & tmpD & " DESC;" This stuff was added: ,customers.name,customers.lastName FROM ((ProductsOrdered INNER JOIN Orders ON ProductsOrdered.idOrder=Orders.idOrder) INNER JOIN customers on customers.idcustomer=orders.idcustomer) So it will pull customers.name and customers.lastName from the database. Then on line 189: do until rs.EOF pc_idorder=rs("idorder") pc_idcustomer=rs("idcustomer") pc_orderDate=rs("orderDate") custName=rs("name") & " " & rs("lastName") This grabs the database query info and puts it into a variable custName Then on line 259: <td nowrap><a href="viewCustOrders.asp?idcustomer=<%=pc_idcustomer%>" target="_blank" title="View all orders by this customer"><%=custName%></a></td> This shows the previously defined custName variable. |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |