Calculating Between 2 Tables In One Report
Jan 19, 2007
Goodmorning,
In one report I have 2 tables. Both tables are related to a different data set. Now I want to create a calculating between a field of the table 1 and a field of table 2.
Does anyone know how to?
Thx anyway!
View 6 Replies
ADVERTISEMENT
Nov 15, 2005
Hi All,
I have a very complicated project and for some reason I have decided to use SQL server as the backend database. I am new to it and have encountered my first problem. In basic terms what I want to be able to do is increment/decrement a field in a table according to something that happens in a different table. Where do I start?
So for example, a stereo system/cd player can have 10 cds at one particular time, when 2 cds are removed, then 8 slots are available. Then when 1 of the 2 remaining slots are filled then 1 slot remains and so on....so I want some sort of a counter field. Using that field I want to be able to generate a report on what is currently available.
Please Excuse my lame example but can anyone please help?
Thanks
Ben
View 1 Replies
View Related
Mar 16, 2008
Hello everyone,
I'm trying to build a report that calculates a summary of all my applicants based on the center they're enrolled in.
I have built a table that displays all applicants and sorts them by the center and I can use the count function to get a count of ALL applicants for all centers, but not a count of each center in one report:
example:
Applicant1 Field1 Field2 Field3 Center 1
Applicant2 Field1 Field2 Field3 Center 1
Applicant3 Field1 Field2 Field3 Center 1
Applicant4 Field1 Field2 Field3 Center 1
Applicant5 Field1 Field2 Field3 Center 2
Applicant6 Field1 Field2 Field3 Center 2
Applicant7 Field1 Field2 Field3 Center 2
I need the count of all applicants from center 1, center 2, etc..
In this example I need 4 for center 1, 3 for center 2 etc..
View 9 Replies
View Related
Aug 6, 2001
Hi,
how do i calculate rowsize for user tables in a database
Thanks in advance.....
jfk
View 3 Replies
View Related
Aug 29, 2014
I have a table which contains readingtime (records every 4 seconds during the day) and an energy reading. I wanted to know how much energy was used in a day. This is the query that i used
SELECT date(readingtime), max(energy)-min(energy)as total FROM lights_1 WHERE readingtime between 20140407000000 and 20140409235959 Group by date(readingtime) LIMIT 0,30;
This gave me the desired results for 1 table. I have 4 tables of these lights_2, Lights_3, lights_4 and i would like to display them together and hence match up the reading time so each day has the energy requirements for all for tables with the total. When i try and join tables i get a lot of errors!
View 1 Replies
View Related
Feb 18, 2008
I want to create a report (report Services) that shows information from start date to end date.
Which function I use to calculate the start date considering that:
end date= today
number of days = -31 days
start day = today - 31 days.
Thank you so much.
IndyW.
View 3 Replies
View Related
Apr 30, 2008
RE: Quarterly report - calculating for each of the next four months?
As I play with joins and functions to help mold my data.. I'm
thinking
about options.
I have a status table with termination status entries that will
dictate participation spans for members.. a member can have multiple
stop and start status entries in that status table. I've built an
sql function that given a member's ID and a month/year will return the
number of days the member particpated in the month.
I need to produce an SSRS report that given a starting month/year
will report days of activity for every member for the next four months.
So my report will look like this:
memberid 2007/06 2007/07 2007/08 2007/09
001 10 0 20 5
002 0 2 55 1
Should I build a view that given the starting yearmonth returns
month1 - 4's data in a row?
or is there a smarter design? Possibly a row for each month? or SSRS
formulas? Maybe the formula is gonna be a performance killer.
Thanks for any help or information!!!
View 4 Replies
View Related
Feb 24, 2005
Hi,
I'm using scalar UDFs in SQL server to return computed values. I've been trying to use the same udfs to perform the same computations but from different tables, but I'm not sure how. Can someone please help???
Here's an example of a counter that I'm using to return the number of days.
CREATE FUNCTION [dbo].[MarketPulse_fn_Counter] (@date smalldatetime, @date2 smalldatetime, @osid int)
RETURNS int AS
BEGIN
return (select count(*) from MarketPulse_0ndqc
where stockosid = @osid and createdate <= @date and createdate >=@date2 )
END
How can I use this same UDF to do the same computation but to SELECT from another table and return that value?
View 4 Replies
View Related
Mar 5, 2008
When viewing a report our users see that it is x number of pages, however when they print the report is actually y number of pages. For example once a report is ran, it says that it is 43 pages, however in actuality it is 62 pages. If they only want to print the last page, they choose to print 43 from the print dialog box, but that gives them a page in the middle of the report not the last page. Is there a way to remedy this?
Thank you,
Kaysie
View 14 Replies
View Related
May 15, 2008
Hi,
I am sure there is a simple answer to this, but I cannot find it at the moment???
I have a simple data table in SQL which gives me Division, PL Measure and Value...
SQL Table
Division
PL_Desc
Result
A
Total Labour Costs
10
A
Total Sales (inc Machine Income)
100
B
Total Labour Costs
5
B
Total Sales (inc Machine Income)
100
C
Total Labour Costs
9
C
Total Sales (inc Machine Income)
100
I need to report on this and calculate a ratio, so I have pushed this into a Matrix Report but cannot work out how to get the ratio column to work???...
Matrix Report
???????????
Division
Total Labour Costs
Total Sales (inc Machine Income)
New Column = Labour / Sales
A
10
100
10%
B
5
100
5%
C
9
100
9%
Grand Total
24
300
8%
If anyone can help save me from my own stupidity!
Cheers, Matt
View 6 Replies
View Related
Sep 21, 2015
I have a ssrs report having 2 tables in with 4 columns in each. When I go to export option in preview I can see all data coming in one excel sheet, But I am trying to get 2 tables in 2 different pages in Excel when I export.First page of excel comes with first table data with 4 columns and second page of excel comes with second table data with 4 columns .
View 2 Replies
View Related
May 31, 2007
The version of Report Builder I have will only let me choose from a very limited range of layouts. For example, the tabular layout displays a single table on a page.
Is there a way to produce a report containing two tables and other fields?
For example, I would like to create a very simple customer report with customer name and address at the top, then a table containing all contacts I have for the the customer (a 1:N sub-table of customer) and then a second table containing all the orders from the customer (a 1:N sub-table of customer).
Is this possible in the current version of Report Builder or is it planned in a future relase?
P.S. I know this is easy in VS Report Designer but I specifically want to do this in Report Builder. The Report Designer client is simply too complex for my non-technical user base. Report Builder would be ideal.
View 3 Replies
View Related
May 24, 2007
Hi Guys,
I am trying to build a report that will present data from 2 sql tables. Here is the scenario:
I have 2 Tbales:
1. TimeSlots - has SlotID and Time columns
2. Reserv - has SlotID, Name, Comments, Date
I am trying to build a report that will show all SlotID's from TimeSlots for a certain Day. The report should show all Time slots regardles if there is a reservation for that TimeSlot, also the Name and Comments for the Time Slot that is reserved.
The idea is that if a time slot is not reserved it should still print on the report which will then be given to the user who will manually pencil in the data should a pop up reservation occurs.
For Example:
SlotID Time Name Comments
1 6:00
2 6:15 Sven Employee
3 7:00 Randy Employee
4 7:15
Please help as i am lost!
regards
SD
View 3 Replies
View Related
Feb 26, 2000
I have a question about 2 tables like:
table1
UserID UserName
01name1
02name2
03name3
04name4
table2
UserID VisitDate
023/10/1999
0422/9/1999
0222/9/1999
0310/9/1999
I want to use one sql statement to produce the following report:
UserID UserName Visit_Num
01name10
02name22
03name31
04name41
(just count how many times the user visited,if not put 0 ,but must has all UserID and UserName)
how can I do that?
thank you
View 1 Replies
View Related
Nov 28, 2007
Hi. I have a report which has several datasources which require a table to be populated before they read from it.
i.e. The first thing that needs to happen whenever the report is run, is a call to a stored procedure which populates the table the report datasources are based off of. The SP takes several minutes to complete and MUST complete before any of the datasources fetch their data.
How can this be achieved?
I can not find anything in the Visual Studio Report Designer which allows to me to instruct Datasource B to not execute before Datasource A has completed (or any other way to call a data population SP, before the data reader SP's execute).
Thanks.
View 2 Replies
View Related
May 6, 2007
Hi,
Can anyone help me with the expression I need to use in order to hide a table with no rows? I have put my table inside a rectangle with the idea that I would just hide the rectangle if there weren't any rows but I can't find any examples of what expression I can use to specify the no rows condition.
Thanks!
Debi
View 5 Replies
View Related
Sep 11, 2014
how to count from multiple tables. So currently I pull two separate reports to show the count of TaskIDs by customer state and another to show WrapID by Customer state for last month:
TaskID Count by Customer state Query:
---------------------------------------
SELECT CU.CustomerState as 'State'
,Count (CM.TaskID) as 'CaseCount'
From Customer CU
LEFT OUTER JOIN ACN_CCPCaseManagementTask CM ON CU.CustID=CM.CustID
[code]...
I am wanting to add both these counts into a single report so i tried the follow query but the counts don't match to the reports I pull separately.
SELECT CU.CustomerState as 'State'
,Count (CM.TaskID) as 'CaseCount'
,Count (CW.WrapCodeID) as 'WrapCount'
From Customer CU
LEFT OUTER JOIN ACN_CCPCaseManagementTask CM ON CU.CustID=CM.CustID
LEFT OUTER JOIN acn_ccpwrapcode
[code]....
View 2 Replies
View Related
Sep 20, 2006
I have the following cursor that I am comparing 2 tables, theproduction table and a copy of the production table, I want results ofall address's that are like the address1 field...the problem is...myresults are giving me every field and if there is more than one, it isputting it in a grid....I only want to see results if they are 1 for the same address fieldthis is what I have so far....declare @address1 char(61),@city char(61)declare address_cursor CURSOR FORSELECT address1,city FROM test.dbo.testaddOPEN address_cursorfetch next from address_cursor into @address1,@citywhile @@fetch_status = 0BEGINselect * from testadd where @address1 like '%' + address1 + '%' and@city = cityFetch next from address_cursor into @address1,@cityPrintENDCLOSE address_cursorDEallocate address_cursor
View 4 Replies
View Related
Feb 19, 2008
I have 2 tables in a report and have set the FixedHeader property of the 3 left columns on both tables to True.
The report displays perfectly when previewing, but when deployed and viewed in IE6 fixes only the columns from the first table
(all columns from 2nd table display, but the 3 columns with FixedHeader set to true scroll out of view when report is scrolled right)
and additionally displays an error.
Error:
Line: 13
Char: 1080
Error: 'children.0.children.0.children.1.children' is null or not an object
Code: 0
URL : <URL of report displayed here>
Possible additional points of interest.
1)There are some groupings in the second table which are initially hidden and toggled by cells in the 1st or 2nd column of the table.These 2 columns are the first 2 of the 3 columns having FixedHeader set to True.
2)If the 1st table is moved physically to below the 2nd table, FixedHeader fails on both tables.
Is there something that I've set up incorrectly?
Any help is appreciated.
View 2 Replies
View Related
Jun 18, 2007
Experienced memebers,
I have what should be simple question about related tables in a dataset and using those fields in a report. Here is my simple design.
Order Header -> Line Item -> Line Discount -> Discount Table
Now when designing this report I cannot seem to access the related discount records for the line item. (as more than one can be applied) Every time I try to drag an field from one of the tables in the dataset to my report it automatically adds "First()" onto the field value expression. This seems to work fine for the order header, but doen't even come close to getting the right discount on the line item? I basically need to pass through the Line Discount table to get to the discount name field to put on the same line as my line item data on the report.
I have looked and googled for for an example on this, but have come up short. Can anyone point me in the right direction?
Thanks,
Chris
View 5 Replies
View Related
Jan 14, 2008
A report I am currently working on is a payslip report.
This report has multiple tables on the page, each linked to their own specific dataset.
Eg I have Taxable Allowances table linked to a dataset that returns information relating to any taxable allowances for an employee, then Non-Taxable allowances, Deductions and so on...
Taxable allowance dataset example
SELECT
TA.TaxableTrDesc,
TA.TaxableTrText,
TA.TaxableSubQty,
TA.TaxableTrRate,
TA.TaxableTrFact,
TA.TaxableSubTtl
FROM
Employee E
INNER JOIN TransCurrentMaster TCM ON E.EmployeeCode = TCM.EmployeeCode
CROSS APPLY udfReportTaxableAllowances(E.EmployeeCode, TCM.PaySequence, ) TA
WHERE
E.EmployeeCode IN (@EmployeeCodeParameter)
AND TCM.PaySequence IN (@PaySequenceParameter)
The report works fine when you select one employee.
Currently when you try to select more than one employee, all the employee results are displayed in the tables, for example, Taxable Allowance table contains all taxable allowances records for all employees on the one page...
I'm not sure how I can amend this report so that it is able to be run for multiple employee records...
Any ideas, thoughts, feedback would be much appreciated..
Cheers
View 4 Replies
View Related
Sep 25, 2007
I have a report with 5-6 tables showing different summary information. These are set up to all go one after another and there are no page breaks. The only instance I would like a page break is if a table content is getting split cross pages. Is there a way for me to specify that a table will be on a new page if it is broken accross multiple pages?
(This is due to Row growth, not column growth)
(KeepTogether is set to true)
Any help is greatly appreciated.
View 3 Replies
View Related
Sep 11, 2007
Hi all ,
When i Run the report in reporting services, it locks the tables.
so is there any option to Unlock the tables. I m using just select query to run the report but when i run the report it locks the tables.
I used with(nolock) option in select query but it didnt work...still showing me lock on the tables.
Pls help...its urgent
Thanking You,
Rupali Rane.
View 2 Replies
View Related
Dec 11, 2004
Hi,
These are my tables
auth:
id, level, base
info:
aid, name
store:
aid, itemID
aid is the ID that comes from the auth table.
The final output that I plan to get is
Name Number of Items
where name comes from the info table, and number of items comes from the store table.
Query something like:
show the total number of items for all those users (in the fashion Name, Number of items)from the store table, for all those whose level=something and base=something in the auth table.
For example,
if there are 10 users whom match level=something and base=something in the auth table,
What I want displayed is:
------------------------
Name Number of Items
------------------------
user1 10
user2 15
user3 20
....
user10 30
-----------------------
which if broken up is:
select name from info where aid=X
select count(*) from store where aid=X ..
for all those whose base=something and level=something from auth.
Thanks,
Shashi
View 1 Replies
View Related
Jan 18, 2008
Hi,
I have an issue in generating the report in sql reporting services. I need to display a report in a table format. The datas of the table should be from two different sql tables. I have tried to write a stored procedure that returns two result sets from two different tables. As reporting services takes datas only from the first result set, i tried to write two different stored procedures each displays one result set. Then i have created two datasets with that two different stored procedure. Even then i cannot proceed as i was not able to use two different dataset in a single table because i was setting the datasetname to one dataset, when i try to retrieve the fields from another dataset i was able to retrieve only first and count values. Then i tried using sub reports. As sub reports for a dataregion(table) repeats for every row of the main report i was not able to fetch the correct datas. Atlast i have tried combining the query using join and wrote a single stored procedure. This stored procedure returns a single result set retrieves data from two tables satisfying the conditions. The issue i am facing with this is, the first table has only one row satisfying the condition and the second table has three rows satisfying the same condition, as i am using join query for the three rows returned by the second table the first table datas are getting duplicated for the rest of the rows in the second table. As I found using join query is the only resolution for the output which I need, and also I have to avoid the duplication of the records. Hence let me know for any solutions.
I have shown the sample datas that is duplicating which is indicated as bold. Phonenumber, Attemptdate and calloutcome are from first table and start time and endtime is from second table. As there are three different datas for the second table, first table datas are duplicated
Phone Number
Attempt Date
Call OutCome
Start Time
End Time
843-577-0800
2007-09-10 15:20:00.000
Contact with Prospect - Expressed Interest
15:08
15:12
843-577-0800
2007-09-10 15:20:00.000
Contact with Prospect - Expressed Interest
15:25
15:25
843-577-0800
2007-09-10 15:20:00.000
Contact with Prospect - Expressed Interest
15:26
15:27
Thanks for any help in advance
Thanks,
Sangeethaa
View 3 Replies
View Related
Aug 17, 2007
Please help, i am really really struggling for a logic to handle 100's of reports we have via button click from asp.net webform.
in the button click i am constructing the url :
**************************************************************************************************************
http://localhost/reportserver?/MyReports/StatusReport&UserID=1&ContractID=1&subcode=null
*************************************************************************************************************
I have a table would like to maintain the parameters required for the chosen report:
when the user chooses from list box on the webform for StatusReport, immedeately it fetches the parameters related to Statusreport and gets everything which is stored with a space in between for each parameter, for this report i have 3 parameters:
UserID ContractID subcode
now how can i construct the string based on the above parameters , i am using vb.net as code behind for my webform(asp.net)
please any ideas will help me achieve the logic. please help thank you all very much.
View 4 Replies
View Related
May 11, 2015
I have a report with 2 tablixes, both the tablixes can be hidden based on the parameter selection. The 1st tablix has a drill through action on one of the columns, that calls the 2nd tablix in the SAME report. Once you click on the drill through, the 1st tablix is no longer visible, only the 2nd one is.
The report is working fine, until you export it to CSV file. Once you are on the 2nd tablix (1st one is NOT visible at this time in the report), and then when you export it to CSV, BOTH, the 1st tablix as well as 2nd tablix are visible in the CSV file. Why does the 1st tablix come up in CSV IF you just exported 2nd tablix to CSV?
Is there a workaround to NOT show the parent/1st tablix at all if the 2nd tablix is exported? Excel works fine!I know sub-reports instead of multiple tablixes might solve this issue.
View 4 Replies
View Related
Feb 19, 2008
hello to all..
can someone tell me how I counld get a pagefooter linked textbox to show a data bound
page footer in a report having 8 tables....???
I have tried the common solution showed on the previous forums..
They worked when there was only one table...
where in i could place a group in 1 of the cells in the table body of the report.
but now since der are 8 tables in the report.. d job is become very tricky.
the page footer is not showing up on all the pages of the report.
it only shows on the first page of the report.
Plz help......
Regards
Savio.
View 1 Replies
View Related
Sep 12, 2007
Hi All,
We are post-deployment with a serious reporting issue that's causing us to rethink our reporting solution. We're considering moving from what we have to SQL Server Reporting Services (client side).
I have spent the past couple of days getting up to speed on this feature and seeing if we can easily migrate it into our existing application. However, I've hit a couple of stumbling blocks and was hoping perhaps someone here could either tell me the solution or point me in the right direction.
I'm not having any problems creating basic reports (e.g. flat data).
However, I am having problems creating reports where there are related tables in a dataset.
The way it works with our existing solution is that I get a dataset (which contains several data tables) and point it to the report's datasource. That report expects those tables and I have defined table-relationships in the report which process and display the information correctly.
I'm not having as much luck with RDLC.
I can go into futher detail about how I'm creating the report, but let me just ask these general questions first:
1. Can I set a dataset containing multiple datatables equal to a property on an RDLC report and that RDLC report know how to treat and display the data?
2. Is there a better/smarter than this to get a field selection from my datasource (remember, this information is coming from a stored procedure so connecting directly to the database is not an option):
a. In code, populate dataset
b. In code, write dataset schema to xml (e.g. an xsd file)
c. In Visual Studio, add the XSD file to project
d. Use fields from XSD file to drag and drop fields on report
A fancy example would be nice too. I've googled like crazy the past couple of days and downloaded as many samples as I can find (including the ones on ftponline.com, gotreportviewer.com, "Tudor's WebLog", and several others). However, I have yet to find one that uses grouping and related datatables.
Thank you so much (if, for nothing else, reading this post )
View 4 Replies
View Related
Oct 19, 2015
I have below tables in my power pivot.Fact 1 & Fact 2 - connected directly to Mainframes - Data is from the same table broken up due to size of the data.Date Table - Relation ship between both the fact tables.How do i create a summary pivot to get the number of tasks that have been completed in each month.
Month Count
July
August
September
October.
View 3 Replies
View Related
Sep 26, 2006
I want to sum up a column, but only summing up the top 25 quantites and then I want to subtract the sum of all quantities from the total of the top 25...how would this be done with t-sql?
View 3 Replies
View Related
Jul 2, 2001
SQL7
I am interested in your opinion on the creation of primary keys in a table - simple ones that is. It would be the replacement for an Identity column.
Some say calculate the value off a lookup table, others say use an external object like c++ dll reading/incrementing from a flat file.
Using an identity column reduces portability of the table.
Thoughts ?
Craig
View 2 Replies
View Related
Nov 15, 2001
Hi,
What the best way to calculate the age given two datetimes.
I tried using the DATEDIFF(yyy,startdate,enddate) but that seems to only compare the year and not look at the specific day.
I am looking for something that would return the following output
birthday= 12/6/1973
EndDate = 11/30/2001
then the age should be 27
If birthday = 12/6/1973
enddate = 12/11/1973
then the age should be 28
thanks in advance
Zoey
View 3 Replies
View Related