Search

Index

Revindex Storefront

Export orders (SQL)

Last updated on 2015-06-05 1 mins. to read

You can also export to CSV or Excel file using the Host > SQL module with the latest DNN 7.2 or higher. You will require host account access to run this operation. This allows you to manipulate the data to suit your file format.

  1. Login as host.
  2. Go to Host > SQL page.
  3. Choose "SiteSqlServer" for your Connection dropdown.
  4. Enter the following SQL query where X is your portal ID number.
    
    SELECT *
    FROM {databaseOwner}{objectQualifier}Revindex_Storefront_SalesOrder
    WHERE PortalID = X
    
    SELECT sod.*
    FROM {databaseOwner}{objectQualifier}Revindex_Storefront_SalesOrderDetail sod
    JOIN {databaseOwner}{objectQualifier}Revindex_Storefront_SalesOrder so
    ON so.SalesOrderID = sod.SalesOrderID
    WHERE so.PortalID = X
    
  5. Click Run Script.
  6. Once the results are displayed, click on the Export to CSV or Export to Excel buttons depending on the file format you like to safeguard.

SQL query is very flexible as it allows you to specify only the columns you want. For example, you can modify the query above to show only the columns SalesOrderID, OrderDate and TotalAmount:


SELECT SalesOrderID, OrderDate, TotalAmount
FROM {databaseOwner}{objectQualifier}Revindex_Storefront_SalesOrder
WHERE PortalID = X

You can also limit the number of records to return only 100 records and order by descending order like this:


SELECT TOP 100 SalesOrderID, OrderDate, TotalAmount
FROM {databaseOwner}{objectQualifier}Revindex_Storefront_SalesOrder
WHERE PortalID = X
ORDER BY SalesOrderID DESC

You'll find countless online tutorials on how to manipulate SQL queries. 


Comments


Powered by Revindex Wiki