473,387 Members | 1,745 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,387 software developers and data experts.

How can I add and subtract transaction in one column

Hello I am new with access, so I have a little idea about the software (started learning).

I have a query where I need have a column that will show the net transaction meaning: where it summarizes all deposits minus the sum of all (withdrawals, cheques and other payments)

I have the following tables:
Banks (ID/Name/address)
Account (ID/Number/Bank ID/Account type)
Customer (ID/ Name/ Address)
Transaction (Id/Account ID/date/Type ID/amount)
Transaction type (ID/Transaction types)

Thanks for all the help I can get
Mar 20 '14 #1

✓ answered by Seth Schrock

You would do yourself a favor if you added a field to your Transaction Type table to signify whether the transaction is a debit or credit. It makes this problem easier and it also makes it very easy to add new transaction types in the future without major design changes.

Do you need the query to show all the records, or do you just need the summary information? Also, with the fields you provided, there is no connection between the transaction and the customer, so there isn't a way to group by the customer.

5 1261
Seth Schrock
2,965 Expert 2GB
Does your Transaction Type table contain the information as to whether the transaction is a debit or credit? What query would this column be going in? Are you needing a line-by-line detailed query that has a total at the bottom? Without these (and possibly others) details, it will be difficult to provide a good solution for you. In general, there are usually several ways to any given thing. Which one is best for a particular situation depends on the situation.
Mar 20 '14 #2
Thanks a lot Seth Schrock.
The transaction Type table only shows the name of the transaction, and the Transaction table shows the amount of each transaction. The query has to be a group by: by bank, by client, by month and by transaction type (cheque, deposits, and others). It does not have to be at the bottom (I forgot to mention that is have to be by client) by bad.

Thanks again
Mar 20 '14 #3
Seth Schrock
2,965 Expert 2GB
You would do yourself a favor if you added a field to your Transaction Type table to signify whether the transaction is a debit or credit. It makes this problem easier and it also makes it very easy to add new transaction types in the future without major design changes.

Do you need the query to show all the records, or do you just need the summary information? Also, with the fields you provided, there is no connection between the transaction and the customer, so there isn't a way to group by the customer.
Mar 20 '14 #4
Excellent!!! Seth Schrock I try your suggestion to add a column and identify the transactions as debit or credit, and you were right It worked.

Thanks a lot
Mar 20 '14 #5
Seth Schrock
2,965 Expert 2GB
Glad to be able to help.
Mar 20 '14 #6

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

Similar topics

4
by: Westcoast Sheri | last post by:
Two mySQL Questions: 1.) how to numerically increase or decrease the value of a mySQL column 2.) what is the best column structure (e.g. "varchar" or "char" etc.) for speediest...
4
by: Leaf | last post by:
Greetings, I've been reading with interest the threads here on deadlocking, as I'm finding my formerly happy app in a production environment suddenly deadlocking left and right. It started...
1
by: Julia | last post by:
Hi, I have a list of addresses in a data base each address row contain a column name 'SENT' which indicate if a message was sent to this address a component is sending email messages to all...
2
by: msnews.microsoft.com | last post by:
Hello, I have the scenario. I m building an application either in asp.net or window application. This application is base on n-tier application model. Let us take example of Northwind Database in...
6
by: Thapliyal, Deepak | last post by:
Hi, Assume I have a bank app.. When customer withdraws $10 from his accouint I have to do following --> update account_summary table --> update account detail_table Requirement: either...
6
by: Giacomo | last post by:
Hi, I've the following problem. I must delete a column DEFAULT from a table, but I must do it with a script, independently from the server where it'll be executed. Locally I've tried with: ...
4
by: =?Utf-8?B?QW1pciBUb2hpZGk=?= | last post by:
Hi I have a GridView that is displaying master records. Some of these records have child records. I would like to a column to my master GridView such that for each master record that has...
2
by: doomsday123 | last post by:
I want to create a query that will subtract a given number from a value in the database and store it in the same spot the value was. For example, a customer has a balance of 23.22 which is stored...
2
by: NarutoFanatic | last post by:
Hello, I'm having trouble using a transaction - rollback statement in sql. I can't seem to have the rollback executed during an error when i've altered a table to add a column with the same name...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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...

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.