Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem summing fields from 2 tables

Status
Not open for further replies.

aageorge

Technical User
Jun 28, 2003
51
US
I have two tables:
T1 T2
Date A B C Date A C D
8/1 10 10 10 8/1 20 20 20
8/2 15 15 15 8/2 10 10 10
8/3 20 20 20

Then I have a query based on these tables with the following fields:

Date A B C D
(T1) (T1+T2) (T1) (T1+T2) (T2)
8/1 30 10 30 20
8/2 25 15 25 10

The problem is that 8/3 counts won't appear unless I add an 8/3 entry on T2 with zero counts. Is there any way to solve this?
 
Change the join between the two table in the design view of the query. Right mouse click on the join and select the option: Select all from T1 and only those were T2 match.



"I know what you're t'inkin', ma petite. Dat Gambit... still de suave one, no?"
 
jfgambit,

I tried your approach, but it just has date entry but with no counts, i.e; the output is

8/3 - - -

another problem is that either table can be missing a date entry, so the join statement will not be correct in every situation.

rolliee, can you give me an idea on the type of vbcode that can solve this problem.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top