Jump to content

Order by date in multiple tables


ramli

Recommended Posts

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.