ramli Posted April 22, 2007 Share Posted April 22, 2007 I have four tables. ## Income #################### #User ID |Number |UniqeID |date # #1 |300 |2 | 1-2-2006 # #1 | |3 | 1-3-2006 # ############################ // if number is empty ## Income items################# #User ID |Number |UniqeID |date # #1 |400 |3 | 1-3-2006 # #1 |244 |3 | 1-3-2006 # ############################ ////////////////////////////////////////////// ## Outcome ################### #User ID |Number |UniqeID |date # #1 |400 |2 | 1-2-2006 # #1 | |4 | 1-3-2006 # ############################ // if number is empty ## Outcome items ############### #User ID |Number |UniqeID |date # #1 |400 |4 | 1-3-2006 # #1 |200 |4 | 1-3-2006 # ############################ Desierd outcome: # Type # Number # UserID # date # # Outcome | 600 | 1 | 1-3-2006 # # Income | 644 | 1 | 1-3-2006 # # Outcome | 400 | 1 | 1-2-2006 # # Income | 300 | 1 | 1-2-2006 # ############################## Explaination: Select in "outcome" and "income" the data and sort by "date" and display it. Next if in "income" there is no "number" present search in the table 'income items" for the same "uniqeID" and add them up to eachother and display it. I have search several forums for the aswer i hope one of you can help me with this problem. thanks in advance. Link to comment https://forums.phpfreaks.com/topic/48161-order-by-date-in-multiple-tables/ Share on other sites More sharing options...
fenway Posted April 23, 2007 Share Posted April 23, 2007 You actually have 4 tables for this? Link to comment https://forums.phpfreaks.com/topic/48161-order-by-date-in-multiple-tables/#findComment-235985 Share on other sites More sharing options...
ramli Posted April 25, 2007 Author Share Posted April 25, 2007 yes Link to comment https://forums.phpfreaks.com/topic/48161-order-by-date-in-multiple-tables/#findComment-237952 Share on other sites More sharing options...
fenway Posted April 25, 2007 Share Posted April 25, 2007 Why? Link to comment https://forums.phpfreaks.com/topic/48161-order-by-date-in-multiple-tables/#findComment-238587 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.