Jump to content

SQL manager issue


Recommended Posts

Hi everyone,

 

I am trying to make a custom sql report from my shop to make the shipping easier. I need multiple data and as I am filling them into excel there are some blank columns so I created some in the sql too. But when I am trying to copy the report to excel (export is not an option due to encoding issue - some signs are not english) some columnds dissapear. My code is here:

 

SELECT
    CONCAT(c.`firstname`, ' ', c.`lastname`) AS `Meno a priezvisko`,
    0 AS `organizacia`,
    ad.`address1` AS `Ulica`,
    ad.`city` AS `Obec`,
    ad. `postcode` AS `PSC`,
    'sk' AS `krajina`,
    c. `email` AS `Email`,
    0 AS `hmotnost`,
    0 AS `trieda`,
    CONCAT(o.`total_paid_real`, ' ', cu.`sign`) AS `Vyska dobierky`,
    ' ' AS `cislo uctu`,
    o. `reference` AS `VS`,
    ' ' AS `druh dobierky`,
    od. `product_name` AS `Popis`,
    o. `payment` AS `druh nakupu`,
    o.`date_add` AS `Date`
FROM `kjh_orders` o
LEFT JOIN `kjh_customer` c ON (o.`id_customer` = c.`id_customer`)
LEFT JOIN `kjh_carrier` ca ON (o.id_carrier = ca.id_carrier)
LEFT JOIN `kjh_currency` cu ON (o.`id_currency` = cu.`id_currency`)
LEFT JOIN `kjh_address` ad ON (o.`id_customer` =ad.`id_customer`)
LEFT JOIN `kjh_order_detail` od ON (o. `id_order` = od. `id_order`)
LEFT JOIN `kjh_order_invoice` oi ON (o. `id_order` = oi. `id_order`)

 

Does anybody knows where is the problem? or does anybody knows how to change the encoding to UTF with signature? that could help too :)

 

thank you in advance for any help

 

EDIT: SRY EVERYONE, I HAVE JUST FIND OUT, THAT IN THE EXCEL WHICH I WAS COPYING TO, THERE WERE HIDDEN COLUMNS... :)

Edited by tohocasu (see edit history)
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...