Hello again every1 and Merry Christmas :-)
Im trying to get a mysql query to work.
Here is the query :
$Query ="SELECT i.ID, i.Created,.Delivered, n.Available ";
$Query .="FROM invoice_sku s, invoice i, inventory n ";
$Query .="WHERE s.Invoice = i.ID ";
$Query .="AND s.Delivered < s.Quantity ";
$Query .="AND i.Active = 'Y' ";
$Query .="AND s.SKU = n.SKU ";
$Query .="AND n.Available > 0 ";
What im trying to do is to output the orders in the invoice_sku and invoice table, where the inventory of the item is > than delivered, and delivered is < ordered.
I got the query to work, but offcourse it outputs the invoice id as many times as there is items in the invoice_sku that can be delivered. What i want is to output this id number only once, and display in percent how much of the order we actually can deliver.
Hope this was understandable, and that any1 could help me with this query :-)
Thanks
Tom