-1

I want to have an extra column that is linked to an order. I am exporting the report but it recognises the html as text. I export it as OpenDocument Spreadsheet or CSV for MSExcel but no chance.

SELECT o.order_id, oci.count_files, 
       CONCAT_WS(  '',  '<a href="http://domain.co.uk/orders/view/?id=', o.order_id,  '">', o.order_id,  '</a>' ) AS Order_Link
FROM torg.temp_orders AS o
LEFT JOIN (
    SELECT obe_order_master_id, COUNT( id ) AS count_files
    FROM kronos.customer_instalments
    GROUP BY obe_order_master_id
) AS oci ON oci.obe_order_master_id = SUBSTRING( o.order_id, 4 ) 
WHERE o.verified =  'verified'
  AND oci.count_files > 1

Is there any way that after exporting the report the link can be clickable?

Fury
  • 4,643
  • 5
  • 50
  • 80

1 Answers1

0

I have researched about it it is not possible to do this because MySql returns the data as string.

SELECT o.order_id, oci.count_files
FROM torg.temp_orders AS o
LEFT JOIN (
    SELECT obe_order_master_id, COUNT( id ) AS count_files
    FROM kronos.customer_instalments
    GROUP BY obe_order_master_id
    HAVING count(id) = 1
) AS oci ON oci.obe_order_master_id = SUBSTRING( o.order_id, 4 ) 
WHERE o.verified =  'verified'
  AND oci.count_files > 1

But there is a way round after exporting data to OpenDocument Spreadsheet on the new column to do this =HYPERLINK("http://domain.co.uk/orders/view/?id="&A1,A1)

How do I convert a column of text URLs into active hyperlinks in Excel?

But then again there is an other problem with that when I click the link Excel checks the link and tries to wrap it up and then some how in stupied excel way it breaks the bloody link so I wasted all day on this for almost nothing.

Community
  • 1
  • 1
Fury
  • 4,643
  • 5
  • 50
  • 80