Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

URGENT - SQL Query Needed


Mort-lemur

Recommended Posts

Hi,

 

I need to run an SQL query against the database to enable me to download a file with the following data for each order:

 

Date

Order Number

Postage Cost (exc Tax)

 

I need this for a tax return.

 

Many Thanks in advance

Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.

Link to comment
Share on other sites

Hi,

 

I need to run an SQL query against the database to enable me to download a file with the following data for each order:

 

Date

Order Number

Postage Cost (exc Tax)

 

I need this for a tax return.

 

Many Thanks in advance

 

Why not export directly to csv / xcel from phpMyadmin ?

Link to comment
Share on other sites

Heather,

 

Have you looked at Detailed Monthly Sales ?

 

Chris

 

Thanks Chris, but I need to export the data to an excel sheet to enable me to sort it.

 

The problem I have is that I get billed by the courier for his items - so I have invoices I can use for tax calculation.

 

However, for the royal mail system I dont have invoices, and need to collect their costs for the year, the only way I can think of doing this is to dump data to excel, sort by value, then delete the courier costs (they are easy to spot as they are the ones uver £7.00)

 

then total the rest for the given time period.

 

Looked at phpmyadmin but to be honest I am struggling.

 

Thanks

Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.

Link to comment
Share on other sites

Sorted it by downloading the whole Orders Total table via phpmyadmin then carrying out loads of ordering and deleting.

 

Thanks All

Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.

Link to comment
Share on other sites

SELECT o.date_purchased AS 'Purchase Date', o.orders_id AS 'Order ID', ot.value AS 'Postage Cost'
FROM `orders_total` AS ot
JOIN `orders` AS o
ON ot.orders_id = o.orders_id
AND ot.class = 'ot_shipping'
AND ot.value < '7'
ORDER BY o.orders_id DESC

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...