Hi Friends. i am working on my internal work. i am having n dynamic rows, Each and every row contain total. i want to sum all the rows total. i have attached the screen shot for the reference

Member Avatar
Member Avatar
+0 forum 9

I want to show the total qty of these query (total qty from datagridview where ActualQty value will update the values of Used Column) `SELECT COUNT(Software) AS ActualQty FROM tblswlogs WHERE Software='MS EXCEL'` and (**Total** will appear in textbox) `SELECT MAX(used + initialqty) As Total FROM tblswlist WHERE Software = 'MS EXCEL'`

Member Avatar
Member Avatar
+0 forum 1

Cell C4 has the expression =565+660+709+1093 Is there a function/nest of functions that can output the number of values being added? BIG NOTE: I AM NOT ASKING FOR THE SUM OF THE EXPRESSION!

Member Avatar
Member Avatar
+0 forum 1

Hi everyone i need some help down here. i am trying to connect multiple db and at the same time i want to sum the value of the column. what i have right now is this SELECT SUM(total) as branch1sales FROM icm.sales UNION SELECT sum(total) as branch2sales FROM hism.sales its computing correctly but the problem is the branch2 alias is being invoke. what am i doing wrong? see attached image for the output ![Untitled.jpg](/attachments/small/3/2380191a296b9b064ffa52c969a268a3.jpg "align-left") thanks

Member Avatar
Member Avatar
+0 forum 2

I'm sure this is simple, but I'm having a time trying to figure out how to add two fields from two different tables together. <?php include_once('conn/db.php'); $query = "SELECT SUM(`sold`) AS total FROM veggies"; $stmt = $con->prepare( $query ); $stmt->execute(); while ($row = $stmt->fetch(PDO::FETCH_ASSOC)){ extract($row); echo "<small><u>Plants Sold</u>: {$total}</small>"; } ?> The above code is just the total for one table field called sold. I'm trying to add "sold" from the "veggie" table to another table with the same field name "sold", except it's from the "flower" table. Essentially I'm shooting for sum(sold) from veggies + sum(sold) from flowers. If …

Member Avatar
Member Avatar
+0 forum 5

Good day guys, I would just like to share my code and wanted to do something about it. This code shows a loop inside a loop initializing a two-dimensional array named arr with elements [2] and [5]. Here's my code: #include <iostream> #include <conio.h> using namespace std; int main () int arr [2] [5]; int val = 1; for (int i = 0; i < 2; i++) { for (int j = 0; j < 5; j++) { arr [i][j] = val; cout << arr [i][j] << " "; val++; } cout << endl; } getch (); return 0; }{ …

Member Avatar
Member Avatar
+0 forum 3

Hey there, I'm having trouble getting my program to read every instruction to then execute it, as well as displaying everything correctly. Right now my program displays mainly garbage and for now I simply want it to be able to successfully run a simple addition program, so any advice or hints, or even any links to send me for info would be great. Here's my program so far: [CODE]#include <iostream> #include <iomanip> #include <fstream> #include <string> #include <cstdlib> using namespace std; const int READ = 10; const int WRITE = 11; const int LOAD = 20; const int STORE = …

Member Avatar
Member Avatar
+1 forum 4

Hi, I want to Count the number of occurences of data in a table, then multiply it in a value from other table, After that I want to sum up the product of count and the value from other table, As of now, I cant count and then multiple but I cant Sum them Up. This is my SQL code: SELECT orderline.product_id, COUNT(orderline.product_id) AS counted, products.orig_price, (COUNT(orderline.product_id)*products.orig_price) AS product FROM orderline INNER JOIN products ON products.product_id = orderline.product_id GROUP BY orderline.product_id This will return: product_id | counted | orig_price | product| 1 | 4 | 2 | 8 | 2 …

Member Avatar
Member Avatar
+0 forum 1

#include<stdio.h> #include<math.h> int main() { int n,nstart,nstop,nstep,i,j,zNumber; ` printf("Please enter a value of a positive integer nstart: "); scanf("%d",&nstart); printf("Please enter a value of a positive integer nstop: "); scanf("%d",&nstop); printf("Please enter a value of a positive integer nstep: "); scanf("%d",&nstep); printf("Number\t\tzNumber\n"); printf("------\t\t-------\n"); n=nstart; zNumber= double pow(double_n,double_i); while(i<=nstop){ zNumber = 1; i=1; while(i<=n){ zNumber +=i; i++; } printf("%d\t\t%d\n",n,zNumber); n += nstep; } return 0; }

Member Avatar
Member Avatar
+0 forum 9

please help for query... i want sum (kns+kng) by name - [example](http://sqlfiddle.com/#!2/b5a7e6) the result should be: name|sum ----------- john - 36 bart - 16 steve - 53 jim - 10 tnx

Member Avatar
Member Avatar
+0 forum 2

Hi Guys , I couldnt dispay sum of a column of sqlite database in php . I tried the sql statement in database its working fine but not sure how to dispay the result in PHP . I belive i need to fetch it and then dispay any help will be appreciate . Thanks in advanced . Sql statement : <?PHP $dbhandle = new PDO('sqlite:test.sqlite'); $query = $dbhandle->query("SELECT COALESCE(SUM(Qty) ,0) AS TOTAL FROM RMA where (Status='Returne')"); ?>

Member Avatar
Member Avatar
+0 forum 3

Hi, I am using jQuery function to calculate total of item price (label) multiply by quantity (textbox), this is working fine so far. Also, I added additional label for shipping which getting the data from rbl object, also working fine. The calculation I'm trying to get is sum of total+shipping, once I add this code i'm getting strange numbers on the total label. **Here is the total+shipping code:** `$("[id*=lblTotalFishShipping]").html(parseFloat($(".sumOrder").html()) + parseFloat($("[id*=lblTotalFishShipping]").html()));` **Here is the full function:** <script type="text/javascript"> $(function () { $("[id*=quoteOrderAmount]").val("0"); }); $("[id*=quoteOrderAmount]").live("change", function () { if (isNaN(parseInt($(this).val()))) { $(this).val('0'); } else { $(this).val(parseInt($(this).val()).toString()); } }); $("[id*=quoteOrderAmount]").live("keyup", function () …

Member Avatar
Member Avatar
+0 forum 5

So I have the following MySQL query, which works fine: select year(created_at) as year, month(created_at) as month, day(created_at) as day, item_sdb_id, price_per_unit from (select l.item_sdb_id, l.list_price / l.quantity as price_per_unit, l.created_at from listings as l inner join purchases as p on l.purchase_id = p.id where l.item_sdb_id in (12345) and p.created_at > '2013-07-09') as t1 group by year, month, day The problem is that instead of generating a price per unit of one item (12345 in this example) for each year, month, and day, I now want to sum the "list price/quantity" for a number of items (12345, 45278, 00154...), rendering …

Member Avatar
Member Avatar
+0 forum 3

C++ program to find sum of marks entered by 30 students using for loop or while loop/

Member Avatar
Member Avatar
+0 forum 2

I'm trying to display some records which meet some certain criteria. That works fine, but I also want to retrieve the total amount of orders. These are all located in the field 'Amount' from the Orders table. So if record 1 has got '22' in it's amount field, and record 5 has got '55' in it's amount field.. the total should be 77. My sql coding looks like this: SELECT Orders.OrderID, Customers.CustomerName, Orders.OrderDate, sum(Orders.Amount) as total FROM Orders INNER JOIN Customers ON Orders.CustomerID=Customers.CustomerID where customers.country='Germany' order by Orders.Orderdate But it only retrieves 1 record (due to the summage), when I …

Member Avatar
Member Avatar
+0 forum 4

i am getting result of average in int instead of float, tell me where i have made mistake. this is the code. #include<iostream> using namespace std; void getData (int a[], int s); int numbersSum (int a[], int s); float average (int sum, int size); int main() { int size=0; int a[size]; cout<<"how many numbers: "<<endl; cin>>size; cout<<"Enter "<<size<<" numbers:"<<endl; getData (a, size); int sum=0; sum=numbersSum (a, size); cout<<"sum of these "<<size<<" numbers is "<<sum<<endl; float avg=0; avg=average (sum, size); cout<<"the average of these "<<size<<" numbers is "<<avg<<endl; return 0; } void getData(int a[], int s) { for (int i=0;i<s;i++) { …

Member Avatar
Member Avatar
+0 forum 3

Here is my array: $a = array( “1” => “3”, “1” => “2”, “2” => “1”, “1” => “2”, “2” => “2”, ); and my expected output is : 1 = 7 , 2 = 3 How can I do that in foreach?

Member Avatar
Member Avatar
+0 forum 17

i have this new problem i hope that im not a spam here in this site.but i have to do this bcoz i have no where else to go.sorry for my english hope u understand me.in the picture that i uploaded i have textbox1 and textbox2 their value comes from the datagrid table so i want to get the automatic sum of 1 & 2 to the 3rd textbox called **"unit price"**.for short if i press the adodc1 controller the value of **"unit price"** will be change. and if i press the **add to invoice** command button the value in …

Member Avatar
Member Avatar
+0 forum 1

I have the following code that is working but i need further functionality. The code shows the payments made and is based on two tables. The payments table that has the following fields mID, type (account type), dayentered(date when the money was donated) and the members table has the following fields name, mID (this is the primary key) and status Now my proble is that i can not add the following functionality to the code 1. Total for each type of payment account (the payments are based on different types eg for utilities, for building and these are recurrent for …

Member Avatar
Member Avatar
+0 forum 2

Hey guys, New to the site, new to writing SQL queries and have no background in this type of thing. But I've been googling my way to victory for the most part. I'm struggling on probably a very simple problem. I'd like to Sum the contents of a column, if a different value in the row is the same as in another... That was worded horribly - how about an illustration: Seq Unit ID Value 1 1 1000 2 1 100 3 11 300 4 11 1000 5 11 110 6 11 300 7 3 999 8 3 1 9 …

Member Avatar
Member Avatar
+0 forum 10

I choose a program that can read data from a txt file. Now, I input two column from txt file and i want to substract first value of 2nd column to every value of 2nd column. finally I want the sum of substracted values. Can anyone please help me. Actually, i did like substract(1)+substract(2)+substract(3)+.........substract(n). But these becomes so long and mistaken can happened. So, I want a shot rules like h= sum(test[i]-test[0]). #include<iostream> #include<fstream> #include<string> #include<cstdlib> #include<cmath> #include<iomanip> #include <windows.h> using namespace std; //void calculateAverage(); //int calculateGrade(); //void updateFrequency(); int main() { const int size=25; int debug=size; double test1[size], test2[size],h; …

Member Avatar
Member Avatar
+0 forum 2

I'm trying to sum all numeric fields individually. I won't always know the field names, otherwise I could manually construct the query `SELECT SUM(Field1) as Field1, SUM(Field2) as Field2...etc FROM myTable` Is there a way to construct this on the fly in mysql? I'm thinking there's probably a way to incorporate `SELECT COLUMN_NAME FROM information_schema WHERE TABLE_NAME=myTableName AND DATA_TYPE IN('tinyint','decimal')`, but I'm not sure how. Thanks!

Member Avatar
Member Avatar
+0 forum 4

I have a void function that takes data from an ifstream, reads the first value, (which is an ID #), and compares that value against the ID# info from an array of records. If it's invalid, the rest of the line is ignored. If it's valid, it adds the hours worked to the hours worked field in an array of records. Here is what the input file looks like: 123 7.5 56 6.25 99 an invalid id 555 2.5 123 10.0 My issue is there is the possibility of multiple entries for the same ID# and for the life of …

Member Avatar
Member Avatar
+0 forum 3

This code example shows how to create a dictionary with row,column indexed (r,c) key tuples from a typical list of lists 2D matrix. Also an example is shown of the ease of processing the resulting dictionary.

Member Avatar
Member Avatar
+5 forum 4

Okay so I have couple of questions about lists in vb.. Please be aware that it's all related to integers only no strings or others 1. How to sum values of a list? 2. How to sort values of list from highest to lowest? Also how would I display list values in a message box vertically? Example: ...........Message Box............ .1 .2 .3 .4 .5 .6 .................................. I appreciate any answers.. And please let me know if you need further information.

Member Avatar
Member Avatar
+0 forum 1

Hi i'm having a trouble with this i got 3 textbox and i format it to Textbox1.Text = Format(Textbox1.Text, "Standard") Textbox2.Text = Format(Textbox2.Text, "Standard") Textbox3.Text = Format(Textbox3.Text, "Standard") which give something like this 1,230.00 2,500.00 1,245.00 and when i add it `Textbox4.text = Val(Textbox1.Text) + Val(Textbox2.Text) + Val(Textbox3.Text)` the result is this 4.00 how can i sum it when the format is in "standard" or "percent"?

Member Avatar
Member Avatar
+0 forum 3

Hi Guys, I was trying to code in C for the following. You are given with 2 files, file1.txt and file2.txt. The contents of the file contain INTERGER values. Add the contents of the file and write them to another file file3.txt. My code is as follows #include <stdio.h> #include <stdlib.h> int main() { static int data,data1,sum; FILE *f1,*f2,*f3; f1 = fopen("C:\\file1.txt","r"); f2 = fopen("C:\\file2.txt","r"); f3 = fopen("C:\\file3.txt","w"); while(( fscanf(f1,"%d",&data) != EOF ) || ( fscanf(f2,"%d",&data1) != EOF )) { if(data == EOF && data1 == EOF) { break; } else if(data == EOF) { sum += data1; } else …

Member Avatar
Member Avatar
+0 forum 5

Good Day, I have a text file in the .csv format. The file originates as a xlsx (excel) file type. The file looks something like the following. Name Number Lat Long Jan Feb Mar Apr Brockton 24-1670-06 38.145236 145.854921 0.15 0.62 1.25 2.14 Westby 24-7432-04 35.846125 132.743652 0.25 0.94 1.14 2.01 Zortman 24-9910-06 38.418461 125.541525 0.31 0.75 1.51 1.84 Now what I would like to do is select a starting month and an ending month and add them together. For example using the above info, selecting a starting month of Feb and an ending month of Apr add the data …

Member Avatar
Member Avatar
+0 forum 6

I have over 10 text files, each file has exactly 2671 floats e.g. 1.232124234 #line 1 2.324234323 #line 2 . . 1.324234234 # line 2671 I would like to the add together the floats on each line with the float on the corresponding line for each of the 10 files, e.g. "file 1 line 1 float" + "file 2 line 1 float" +.....+ "file 10 line 1 float". I need to do this for each line in the text files and print the sum to a csv on 2671 lines. I can achieve using the following very long code, but …

Member Avatar
Member Avatar
+0 forum 8

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
Member Avatar
+0 forum 7

The End.