if you look at the orders_total table, you'll see it's a many-to-many relationship.
If you're going to attempt a join query as you've indicated, you'll need to restrict your returned values by limiting to just the ot_shipping class.
Further, your join for attributes is preventing you from returning results if the orders don't have any attributes selected in them.
However, this works, without attributes details:```
SELECT
orders.date_purchased,
orders.orders_id,
orders.customers_name,
orders.customers_company,
orders.customers_street_address,
orders.customers_suburb,
orders.customers_state,
orders.customers_postcode,
orders.customers_city,
orders.customers_id,
orders.customers_country,
orders.customers_telephone,
orders.customers_email_address,
orders.delivery_name,
orders.delivery_company,
orders.delivery_street_address,
orders.delivery_suburb,
orders.delivery_city,
orders.delivery_postcode,
orders.delivery_state,
orders.delivery_country,
orders.billing_name,
orders.billing_suburb,
orders.billing_street_address,
orders.billing_company,
orders.billing_city,
orders.billing_postcode,
orders.billing_state,
orders.currency,
orders.order_tax,
orders.order_total,
orders.billing_country,
orders.payment_method,
orders.shipping_method,
orders.shipping_module_code,
orders.orders_date_finished,
orders_products.orders_products_id,
orders_products.products_name,
orders_products.products_quantity,
orders_total.orders_total_id,
orders_total.text,
orders_total.value,
orders_total.class
FROM
orders
Inner Join orders_products ON orders.orders_id = orders_products.orders_id
Inner Join orders_total ON orders.orders_id = orders_total.orders_id AND orders_total.class = 'ot_shipping'
GROUP BY
orders.date_purchased;
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.