1,105,406 Community Members

Sum Function

Member Avatar
Sadhikary
Newbie Poster
7 posts since Dec 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

I have one table with content of data with a Status (Yes/No).

I want to get sum of total data where status is "yes"and put it into another table and sum of total data where status is "no" and put it into previous table in a different column to maintain stock.

Saurav

Member Avatar
deceptikon
Eternally Awesome
4,695 posts since Jan 2012
Reputation Points: 1,341 [?]
Q&As Helped to Solve: 689 [?]
Skill Endorsements: 104 [?]
Administrator
Featured
 
1
 

Good luck with that. I hope you realize that you failed to provide enough information for anyone to help you.

Member Avatar
Begginnerdev
Veteran Poster
1,142 posts since Apr 2010
Reputation Points: 251 [?]
Q&As Helped to Solve: 191 [?]
Skill Endorsements: 15 [?]
 
0
 

If you are using SQL as a backend, you try the command:

Dim cmd As New Oledb.OledbCommand("INSERT INTO table2(YesCount) SELECT COUNT(*) FROM table1 WHERE table1.Status='Yes'",YourConnection)

Give this a try

Member Avatar
Reverend Jim
Noli mentula
5,453 posts since Aug 2010
Reputation Points: 761 [?]
Q&As Helped to Solve: 653 [?]
Skill Endorsements: 51 [?]
Moderator
Featured
 
1
 

I want to get sum of total data where status is "yes"

What you should provide is

  1. the structure of all relevant tables
  2. perhaps a few records with an example of the before and after

This is particularly helpful if you are trying to explain the problem in a language that is likely not your native tongue.

Member Avatar
Sadhikary
Newbie Poster
7 posts since Dec 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

I have 2 tables one is receive and another is sale table.
Receive Table contains
Receive

Sale Table contains
Sale

Now how i can see the stock report after calulating above 2 tables, stock report format like below:

Stock

Waiting for someone's valuable reply..

Saurav

Member Avatar
Sadhikary
Newbie Poster
7 posts since Dec 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

above database is in ms access and developed in vb.net

Member Avatar
Reverend Jim
Noli mentula
5,453 posts since Aug 2010
Reputation Points: 761 [?]
Q&As Helped to Solve: 653 [?]
Skill Endorsements: 51 [?]
Moderator
Featured
 
1
 

How is this in any way related to the original question which asked about a Yes/No status field?

Member Avatar
Sadhikary
Newbie Poster
7 posts since Dec 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Actually i have an another table from which calculation can be done, thats whay i have posted by calculating TRUE and FALES status followed by the modelcode description colour in a particular datewise stock.
tables is given below:
RecVehInfo

want to see tha stock till a particular date, sumation of total true and false status followed by the modelcode description and colour minus sumation of modelcode description and colour where status is false.

Saurav

Attachments
You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: