[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Total

Posted on 2006-11-09
7
Medium Priority
?
325 Views
Last Modified: 2012-06-22
Hi,

I have two tables name tblAMKCC71 and tblAMKCGP:  

In tblAMKCC71 fields are: overnight, dayshift, eveningshift
In tblAMKCGP fields are: overnigh, dayshift, eveningshift

There is a third table  name tblrptPharmacy
In tblrptPharmacy field is: generatedOrders

I want to total tblAMKCC71 and tblAMKCGP fields together and put in tblrptPharmacy field name generatedOrders.

How do i go about doing this.

I know to create a query but i know how to sum single field but not the multiple fields of different table.

I am very beginner programmer in access.  Help greatly appreciated.
0
Comment
Question by:sikan71
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 44

Expert Comment

by:GRayL
ID: 17908431
How does the Pharmacy table relate to the two AMK tables?  What field is common among the  three?
0
 

Author Comment

by:sikan71
ID: 17909117
There is no relationship:  i am trying to put all the totals in table tblrptPharmacy.  So that i can create a report on monthly basis.  I have 10 tables for each building at my work,  the data get entered on daily basis.  But i have created query which pulls the data of previous month and does the sum for each field of each table. for example, Now say i have the sum of each field in the tblAMKC71 and also tblAMKCGP.  I want to add together certain fields of tblAMKCC71 and tblAMKCGP and put it in different table tblrptPharmacy and call the field name generatedOrders. Hope this is clear.
0
 
LVL 44

Expert Comment

by:GRayL
ID: 17909290
Well, here's literally what you asked for:

INSERT INTO tblrptPharmacy (GeneratedOrders) Select Sum(overnight+dayshift+eveningshift) from tblAMKCC71;
INSERT INTO tblrptPharmacy (GeneratedOrders) Select Sum(overnight+dayshift+eveningshift) from tblAMKGCP;

0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

Author Comment

by:sikan71
ID: 17909405
Instead of running a query with insert can i directly use this values in the report.
My problem is since my database has 10 tables(each for different building).  My report needs to use all 10 tables to get the values i need from each field.  As far as i know you can use only single recordsource.  How can i achieve this.  As i mentioned previously very new to access

My report setup:

Building:                ARDC     AMKC        GMDC   ............                                   Total


Type of Orders
# Of Formulary
# Of Nonformulary
Total Orders


# Of Orders
Keep
Detox
Total Orders


So i have it set up like this.

Say for building AMKC:  I need to put the totaled value i mentioned above in the # Of Formulary.  Is it possible to sum here instead of writing separate query.


0
 
LVL 44

Accepted Solution

by:
GRayL earned 500 total points
ID: 17909761
You can use a domain aggregrate function as the control source for a textbox tbxAMKCC71:

=DSum("overnight+dayshift+eveningshift","tblAMKCC71")

then for tbxAMKGCP

=DSum("overnight+dayshift+eveningshift","tblAMKGCP")

and so on.  Does this help?

0
 

Author Comment

by:sikan71
ID: 17909943
Is it possible to combine both tables field values into one since I want AMKCC71 and AMKCGP into the tbxAMKC  There is no tbxAMKCC71 and tbxAMKCGP.  
0
 
LVL 44

Expert Comment

by:GRayL
ID: 17939545
tbxAMKC control source.

=DSum("overnight+dayshift+eveningshift","tblAMKCC71") + DSum("overnight+dayshift+eveningshift","tblAMKGCP")

Thanks, glad I could help.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question