469,332 Members | 6,678 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,332 developers. It's quick & easy.

Cannot get MySQL Query to work in .asp

Hi,

I have a MySQL database and in the front-end software I am using to
Run MySQL, I have created a query on the tables which runs in the
front-end, similar to the MS Access query grid.

I now wish to pull this query on-line using .asp, but I seem to have
found out that I can only pull data from tables in MySQL ?

The query I have is :
__________________________________________________ ___________________

strQuery = "SELECT Customers.CustomerName,Orders.PONumber,OrderLines. JobNumber,OrderLines.OrderQuantity,Products.Produc tName,
SUM( StockMovements.QtyShipped ) AS SUM_OF_QtyShipped,
OrderLines.ShipfromPSL,StockMovements.QtyShipped "

strQuery = strQuery & "FROM StockMovements INNER JOIN OrderLines ON
(StockMovements.JobNumber = OrderLines.JobNumber) INNER JOIN Products
ON (OrderLines.ProductID = Products.ProductID) INNER JOIN Orders ON
(OrderLines.OrderID = Orders.OrderID) INNER JOIN Customers ON
(Orders.CustomerID = Customers.CustomerID) "

strQuery = strQuery & "WHERE (Customers.CustomerName <> 'Black Box
UK') and (Customers.CustomerName <> 'Black Box USA') and
(OrderLines.ShipfromPSL = -1) "

strQuery = strQuery & "GROUP BY Customers.CustomerName,
Orders.PONumber, OrderLines.JobNumber, OrderLines.OrderQuantity,
Products.ProductName, OrderLines.ShipfromPSL,
StockMovements.QtyShipped "

strQuery = strQuery & "HAVING ( (OrderLines.OrderQuantity -
SUM(StockMovements.QtyShipped)) >0 ) ORDER BY Customers.CustomerName,
Products.ProductName;"

__________________________________________________ ______________________
Where am I going wrong ?
Appreciate your soonest help

Thanks

David Gordon
Jul 19 '05 #1
0 975

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Michael J. Astrauskas | last post: by
reply views Thread by Kyle Goetz | last post: by
reply views Thread by David | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.