I'm using a the script below for a custom report. I need to add a column to the report that includes the package(s) each customer has. I figured out how to add the service.id. However this service.id does not equate to a package id.
Here is the script I'm running:
SELECT `contacts`.`client_id`, `contacts`.`id` AS `contact_id`, `contacts`.`first_name`, `contacts`.`last_name`, `contacts`.`email`, contacts.address1, contacts.city, contacts.zip, contacts.country, service.id, `services`.`status`, services.date_added, `services`.`date_canceled`, COUNT(`services`.`id`) AS `number_of_services`
FROM `contacts`
INNER JOIN `services` ON `services`.`client_id` = `contacts`.`client_id`
Question
sonja
I'm using a the script below for a custom report. I need to add a column to the report that includes the package(s) each customer has. I figured out how to add the service.id. However this service.id does not equate to a package id.
Here is the script I'm running:
SELECT `contacts`.`client_id`, `contacts`.`id` AS `contact_id`, `contacts`.`first_name`, `contacts`.`last_name`, `contacts`.`email`, contacts.address1, contacts.city, contacts.zip, contacts.country, service.id, `services`.`status`, services.date_added, `services`.`date_canceled`, COUNT(`services`.`id`) AS `number_of_services`
6 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.