Exporting Order #, Order Notes, sorting by product code? - Ecommerce Forums
Results 1 to 4 of 4

Thread: Exporting Order #, Order Notes, sorting by product code?

  1. #1

    Exporting Order #, Order Notes, sorting by product code?

    We are wanting to export a CSV file with the following data:

    Order #
    Order Notes

    But ONLY for Product "XYZ"

    We aren't getting the "order notes" when we sort by product code and export out of the "export results" on the Orders Overview page. Therefore we only have 2/3 of the puzzle.

    Does anyone here have a solution?

  2. #2
    I am not sure if you are looking for the notes field(s) for a specific product or range of products or just all product with something in the order notes field but this is a start.


    Code:
    SELECT orders.orderid,
           orders.orderdate,
           orders.customerid,
           customers.emailaddress,
           orderdetails.productcode,
           products_joined.productname,
           orderdetails.quantity,
           orders.OrderNotes,
           orders.Order_Comments
    FROM   orders WITH(nolock)
           JOIN orderdetails
           ON orders.orderid = orderdetails.orderid
           INNER JOIN customers
           ON orders.customerid = customers.customerid
           INNER JOIN products_joined
           ON orderdetails.productcode = products_joined.productcode
    WHERE  orders.orderstatus <> 'Cancelled'
           AND orders.orderstatus <> 'Returned'
           AND products_joined.productcode = 'XYZ'

  3. #3
    Or maybe you are looking for this???

    Both this and above where adapted from a different query that I have used which I modified on the fly.

    Code:
    SELECT orders.orderid,
           orders.orderdate,
           orders.customerid,
           customers.emailaddress,
           orderdetails.productcode,
           products_joined.productname,
           orderdetails.quantity,
           orders.OrderNotes,
           orders.Order_Comments
    FROM orders WITH(nolock)
           JOIN orderdetails
           ON orders.orderid = orderdetails.orderid
           INNER JOIN customers
           ON orders.customerid = customers.customerid
           INNER JOIN products_joined
           ON orderdetails.productcode = products_joined.productcode
    WHERE  orders.orderstatus <> 'Cancelled'
           AND orders.orderstatus <> 'Returned'
           AND CONVERT(VARCHAR(MAX), orders.Order_Comments) <> ''
           AND CONVERT(VARCHAR(MAX), orders.Order_Comments) IS NOT NULL
    Last edited by Marc_NY; 05-12-2015 at 04:47 PM.

  4. #4
    I think the first code is the ticket, thanks Marc!

    We should be able to extract the data properly with that code. The only issue we may run into is the formatting as it converts from Volusion into the CSV file. We currently have order notes formatted like this on Volusion orders:

    Dealer#
    Serial#
    We're needing to sort by Serial# so we will try to separate the data into a separate column away from the Dealer# so we can easily sort them correctly.

Similar Threads

  1. Exporting Order Details with Customer Email Address
    By ClarenceRadioRobot in forum Import & Export
    Replies: 8
    Last Post: 10-28-2014, 12:52 PM
  2. Replies: 7
    Last Post: 08-30-2013, 12:24 PM
  3. Replies: 11
    Last Post: 09-08-2012, 10:43 AM
  4. Red Ex On Order Notes
    By AWCthreads in forum V13 Bugs
    Replies: 2
    Last Post: 09-06-2012, 04:57 PM
  5. Order Notes Bounce
    By AWCthreads in forum V13 Bugs
    Replies: 2
    Last Post: 09-06-2012, 04:54 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •