Jump to content

Sum Of MYSQL Values from Different Tables


qadir5000

Recommended Posts

Hi All,

I'm learning PHP still as a beginner and my company has tasked me with creating a program to calculate daily sales by shift.

 

I have two tables:

 

attendance

id

date

time 

brand

branch

shift

 

attendanceout

id

date

time

brand

branch

sales

 

So when employees come in they put attendance in which goes to attendance table and when they go out their entry goes into attendanceout with the their sales of the day.

 

What I want is, data to come like this:

 

Date - Shift - Total Sales

10/02/2014 - Morning - 2000

10/02/2014 - Closing - 1000

11/02/2014 - Morning - 3000

11/02/2014 - Closing - 1500

 

 

I hope I have managed to explain it.

Any reason why you didn't have a simpler

+--------------+
| attendance   |
+--------------+
| employee_id  |
| date         |
| brand        |
| branch       |
| shift        |
| time_in      |
| time_out     |
| sales        |
+--------------+

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.