Page 1 of 1

Need help exporting csv

Posted: Wed Jan 16, 2013 10:18 am
by danonee
hallo i need to export my database now there is a problem i have added a custom field and i wanted to add it in the sql query i have no idea how can i do it

(its custom2) btw

can someone help ? this is my sql query copied from a post here .

SELECT `hesk_tickets`.`id` AS "Ticket Number", `hesk_tickets`.`dt` AS "Date Created", `hesk_users`.`name` AS Owner, `hesk_categories`.`name` AS Category, `hesk_tickets`.`name` AS "Contact", `hesk_tickets`.`subject` AS Subject, `hesk_status`.`name` AS "Status", `hesk_priority`.`name` AS Priority, `hesk_tickets`.`time_worked` As "Time Worked"

FROM hesk_tickets, hesk_categories, hesk_users, hesk_status, hesk_priority

WHERE (

hesk_categories.id = hesk_tickets.category

AND hesk_users.id = hesk_tickets.owner

AND hesk_status.id = hesk_tickets.status

AND hesk_priority.id = hesk_tickets.priority

)-

thx for help in advantage

Re: Need help exporting csv

Posted: Wed Jan 16, 2013 11:45 am
by Klemen
Before FROM add something like this to get contents of custom1 field:

, `hesk_tickets`.`custom1` As "Custom 1"