SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Adding calculated fields from different datasets


Adding calculated fields from different datasets

Author
Message
meichmann
meichmann
Mr or Mrs. 500
Mr or Mrs. 500 (501 reputation)Mr or Mrs. 500 (501 reputation)Mr or Mrs. 500 (501 reputation)Mr or Mrs. 500 (501 reputation)Mr or Mrs. 500 (501 reputation)Mr or Mrs. 500 (501 reputation)Mr or Mrs. 500 (501 reputation)Mr or Mrs. 500 (501 reputation)

Group: General Forum Members
Points: 501 Visits: 211
Hello Everyone,
I have three tables. Each table has a calculated value, and each table has a different dataset. What I need to do is add the values from the three tables and get a grand total.

field a from table 1 (dataset a)
field b from table 2 (dataset b)
field c from table 3 (dataset c)

is there a way to do this?

Thanks!
Henrico Bekker
Henrico Bekker
SSCoach
SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)

Group: General Forum Members
Points: 18711 Visits: 5422
You will need to provide a lot more for anyone to assist you, well, with any quality replies.
Post DDL, sample data, what you have tried so far.

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
This thing is addressing problems that dont exist. Its solution-ism at its worst. We are dumbing down machines that are inherently superior. - Gilfoyle
sgmunson
sgmunson
SSC Guru
SSC Guru (54K reputation)SSC Guru (54K reputation)SSC Guru (54K reputation)SSC Guru (54K reputation)SSC Guru (54K reputation)SSC Guru (54K reputation)SSC Guru (54K reputation)SSC Guru (54K reputation)

Group: General Forum Members
Points: 54112 Visits: 5884
meichmann - Monday, September 11, 2017 10:15 AM
Hello Everyone,
I have three tables. Each table has a calculated value, and each table has a different dataset. What I need to do is add the values from the three tables and get a grand total.

field a from table 1 (dataset a)
field b from table 2 (dataset b)
field c from table 3 (dataset c)

is there a way to do this?

Thanks!

Assuming that there aren't any other complicating factors, you can create a "formula" that adds those calculated field values together in the formula, and then place that formula on the report in an "appropriate place", which will depend heavily on the nature of your data, and whether or not you actually want to sum those "calculated values" across all records from each dataset, or just take one value from each dataset.


Steve
‌(aka sgmunson)
Smile Smile Smile
Health & Nutrition
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search