qadir5000 Posted February 13, 2014 Share Posted February 13, 2014 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. Quote Link to comment https://forums.phpfreaks.com/topic/286164-sum-of-mysql-values-from-different-tables/ Share on other sites More sharing options...
Barand Posted February 13, 2014 Share Posted February 13, 2014 Any reason why you didn't have a simpler +--------------+ | attendance | +--------------+ | employee_id | | date | | brand | | branch | | shift | | time_in | | time_out | | sales | +--------------+ Quote Link to comment https://forums.phpfreaks.com/topic/286164-sum-of-mysql-values-from-different-tables/#findComment-1468724 Share on other sites More sharing options...
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.