Click here to Skip to main content
14,659,434 members
Home » Discussions » Database
   

Database

 
GeneralRe: What do you think of MongoDB? Pin
Nathan Minier20-Aug-18 3:52
professionalNathan Minier20-Aug-18 3:52 
GeneralRe: What do you think of MongoDB? Pin
Eddy Vluggen20-Aug-18 3:56
professionalEddy Vluggen20-Aug-18 3:56 
Questionhow to create a sum query between multiple tables in Microsoft access Pin
Member 1028319111-Aug-18 8:50
MemberMember 1028319111-Aug-18 8:50 
AnswerRe: how to create a sum query between multiple tables in Microsoft access Pin
Eddy Vluggen11-Aug-18 9:08
professionalEddy Vluggen11-Aug-18 9:08 
GeneralRe: how to create a sum query between multiple tables in Microsoft access Pin
Member 1028319111-Aug-18 9:14
MemberMember 1028319111-Aug-18 9:14 
GeneralRe: how to create a sum query between multiple tables in Microsoft access Pin
Eddy Vluggen11-Aug-18 9:20
professionalEddy Vluggen11-Aug-18 9:20 
AnswerRe: how to create a sum query between multiple tables in Microsoft access Pin
Mycroft Holmes11-Aug-18 13:15
professionalMycroft Holmes11-Aug-18 13:15 
AnswerRe: how to create a sum query between multiple tables in Microsoft access Pin
CHill6015-Aug-18 2:15
mveCHill6015-Aug-18 2:15 
As others have pointed out, that is a bad table schema. If you insist on having separate tables for purchase and payment then it should look like this:
Table_provider
 ID_Provider
 Name_Provider

 Table_purchase
 ID_Purchase
 Date_Purchase
 ID_Provider
 Amount

 Table_payment
 ID_payment
 Date_payment
 ID_Provider
 Amount
Personally I would have single transaction table with a transaction type column but each to their own.

Whether you follow my advice or not, you will need to JOIN the tables based on the column that is common to all of them ID_Provider or Name_Provider if you leave things as they are. Here is an article that tells you how to do that Joining Tables in SQL[^]

Note we are referring to "SQL" in the sense of T-SQL - the "language" and not SQL Server the database. As you are connecting from VB.NET to Access I presume you are using ADO or OLEDB - both of which will require SQL statements.

Once you have worked out how to join your tables you already have the SELECT clause essentially written...
SELECT Provider.Name_Provider. Sum(purchase.Amount), sum(Payment.Amount)


Give it a go, but if you still get stuck reply to this message with the code that isn't working and we will try to help.
GeneralRe: how to create a sum query between multiple tables in Microsoft access Pin
Mycroft Holmes15-Aug-18 13:09
professionalMycroft Holmes15-Aug-18 13:09 
GeneralRe: how to create a sum query between multiple tables in Microsoft access Pin
CHill6020-Aug-18 4:15
mveCHill6020-Aug-18 4:15 
GeneralRe: how to create a sum query between multiple tables in Microsoft access Pin
Mycroft Holmes20-Aug-18 12:57
professionalMycroft Holmes20-Aug-18 12:57 
QuestionStored Procedure execution from Entity Framework should return 0 or -1 if insert or update fails Pin
indian1437-Aug-18 14:27
Memberindian1437-Aug-18 14:27 
AnswerRe: Stored Procedure execution from Entity Framework should return 0 or -1 if insert or update fails Pin
Mycroft Holmes7-Aug-18 14:37
professionalMycroft Holmes7-Aug-18 14:37 
GeneralRe: Stored Procedure execution from Entity Framework should return 0 or -1 if insert or update fails Pin
indian1437-Aug-18 14:39
Memberindian1437-Aug-18 14:39 
GeneralRe: Stored Procedure execution from Entity Framework should return 0 or -1 if insert or update fails Pin
Mycroft Holmes7-Aug-18 16:38
professionalMycroft Holmes7-Aug-18 16:38 
GeneralRe: Stored Procedure execution from Entity Framework should return 0 or -1 if insert or update fails Pin
indian1438-Aug-18 6:38
Memberindian1438-Aug-18 6:38 
GeneralRe: Stored Procedure execution from Entity Framework should return 0 or -1 if insert or update fails Pin
Richard Deeming8-Aug-18 0:27
mveRichard Deeming8-Aug-18 0:27 
GeneralRe: Stored Procedure execution from Entity Framework should return 0 or -1 if insert or update fails Pin
indian1438-Aug-18 6:42
Memberindian1438-Aug-18 6:42 
GeneralRe: Stored Procedure execution from Entity Framework should return 0 or -1 if insert or update fails Pin
Richard Deeming8-Aug-18 8:23
mveRichard Deeming8-Aug-18 8:23 
GeneralRe: Stored Procedure execution from Entity Framework should return 0 or -1 if insert or update fails Pin
indian1439-Aug-18 6:05
Memberindian1439-Aug-18 6:05 
QuestionDATABASE Maintainance Pin
ricardobrooks6-Aug-18 3:12
Memberricardobrooks6-Aug-18 3:12 
AnswerRe: DATABASE Maintainance Pin
Victor Nijegorodov6-Aug-18 8:01
MemberVictor Nijegorodov6-Aug-18 8:01 
AnswerRe: DATABASE Maintainance Pin
Eddy Vluggen6-Aug-18 8:15
professionalEddy Vluggen6-Aug-18 8:15 
GeneralRe: DATABASE Maintainance Pin
CHill606-Aug-18 22:01
mveCHill606-Aug-18 22:01 
Questionrecovery method for hard drive Pin
Member 139376004-Aug-18 4:08
MemberMember 139376004-Aug-18 4:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.