Jump to content

MySQL per Job Type?


kinsesyete

Recommended Posts

I want to show the Total Invoices per Month by Job Type, but it seems that it is shwoing the monthly total. I just want to show the total per job type.

Here's what I've done so far:

select `vinvoices`.`yymm` AS `yymm`,
`vinvoices`.`location` AS `job_location`,
`vinvoices`.`job_no` AS `job_no`,
format(sum(`vinvoices`.`amount`),0) AS `amount`,
`tjobtypes`.`type_name` AS `type` from ((`vinvoices` join `tjobs` on((`tjobs`.`job_no` = `vinvoices`.`job_no`))) join `tjobtypes` on((`tjobtypes`.`type_no` = `tjobs`.`type_no`))) 
group by `vinvoices`.`yymm`,`vinvoices`.`location`

Here are the fields for vinvoices:

- date
- job_no - this connects to jobtypes field via the tjobs table
- job_name
- client_name
- amount
- ppaid
- inv_no
- prob
- notes
- contact
- location
- yymm

Link to comment
https://forums.phpfreaks.com/topic/285468-mysql-per-job-type/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.