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. Quote 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? Quote 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 Quote 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? Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.