Forums

This topic is locked

Info from 2 tables in Access

Posted 04 Apr 2003 16:18:08
1
has voted
04 Apr 2003 16:18:08 Storm Tropper posted:
Hi,

I have 2 tables in my Access DB and I would like to sum 2 columns (units D and units V) from each table, is it possible to create a recordset to do this or do I need to something else?

I am using ASP VB.

Regards,

Sanjay

Replies

Replied 04 Apr 2003 17:19:58
04 Apr 2003 17:19:58 Brent Colflesh replied:
Use a JOIN - check out this PDF tutorial:

mis.bus.sfu.ca/tutorials/MSAccess/tutorials/sql_intr.pdf

Regards,
Brent

Replied 04 Apr 2003 22:08:47
04 Apr 2003 22:08:47 Storm Tropper replied:
I've tried using the join, but it seems to give my the wrong value.

the tables have these details:

table1
data units
voice units

table2
data units
voice units

so what want is the (table1 sum(data units) + sum(voice units)) + (table2 sum(data units) + sum(voice units))

The steps I followed are:

Query details:

SUM(table1.`Data Units`) + SUM(table1.`Voice Units`) + SUM(table2.`Data Units`) + SUM(table2.`Voice Units`)

The total I get is 20 but this should be (4 + 7 + 4 + 7) = 22

Regards,

Sanjay

Edited by - Storm on 04 Apr 2003 22:11:03

Reply to this topic