473,398 Members | 2,165 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Sum of column 1st table and Add data on 2nd table

Table 1:
Date OR# Amount
1/1/1990 1 500.00
2/2/1990 2 600.00
=========
1,100.00 How to Sum the Amount Column in 1st Table

Table 2:
Date OR# Amount
3/2/1993 2,000.00

Total Amount : 3,300.00 Add Sum of the 1st Table and 2nd Table
Nov 16 '18 #1
3 1124
twinnyfo
3,653 Expert Mod 2GB
For your first issue:

Expand|Select|Wrap|Line Numbers
  1. SELECT Sum(OrderAmount) AS OrderTotal 
  2. FROM TableOrders 
  3. GROUP BY Sum(OrderAmount);
For your second issue, you may want to provide more information. Why do you have two tables which apparently have the same information? These should be in the same table. Granted, you may just be showing parts of your tables, but it would make sense to have all your orders in one place.

Hope this hepps!
Nov 16 '18 #2
NeoPa
32,556 Expert Mod 16PB
It looks like you need to read about Database Normalisation and Table Structures before even you read the threads that are stickied at the top to help you to write a question that makes proper sense.

Your database design is the more important issue and once you have that fixed you hopefully won't need to try again with your question.
Nov 17 '18 #3
Thanks i will try this
Nov 19 '18 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Peter Foti | last post by:
Hi all, I have a form that contains a 2 column table. In the left column is the description for a particular input (ie - "First Name", "Last Name", "Phone Number", etc.). In the right column...
1
by: Kevin Myers | last post by:
Hello, I'm an experienced application developer in some languages (including various SQL dialects), but have very little experience with MS Access or VBA, and am having trouble figuring out how...
1
by: Sally Ruggero | last post by:
I need advice on archiving data from our production database. Each night I would like to save and remove a day's data from two weeks ago, from all the tables. I know how to delete the...
2
by: News East | last post by:
I have an existing SQL 7 server named HHARBR. HHARBR has a database named SPR with a table named "reportname" in it, the table has the name HHARBR embedded the table data. I migrated the HHARBR...
2
by: Burbletrack | last post by:
Hi All, Hope someone can help me... Im trying to highlight the advantages of using table variables as apposed to temp tables within single scope. My manager seems to believe that table...
1
by: ljungers | last post by:
I have a Report that uses a master table and has been working ok. Now I need to add some data from a second table called locations. The master table has a column named loc_code, and the locations...
5
by: Troels Arvin | last post by:
Hello, Every so often, I'm asked to help people recover data from tables that were either dropped or where to much data was DELETEed. The complications related to restoring data are a problem....
9
by: NEWSGROUPS | last post by:
I have data in a table in an Access 2000 database that needs to be exported to a formatted text file. For instance, the first field is an account number that is formatted in the table as text and...
3
by: Shestine | last post by:
I am trying to add a column to a current table, with data in it. I am only learning, and i have no idea how to change this to make it work. Here is the script I have right now it, but what it does is...
3
by: Csaba Gabor | last post by:
I have a table with 3 rows, and two pieces of data to display in each row. However, the first element of the last two rows and the 2nd element of the 1st row are very short. This would seem to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.