Passing Date Range To A Subreport
Nov 2, 2007
I am passing a date range to a subreport which is a table that I want to show a list of months in a specific range. I am passing:
FromDateShipedYearMonth - ([Date Shipped].[Month].&[2006]&[4]&[12]
ToDateShippedYearMonth - ([Date Shipped].[Month].&[2007]&[4]&[11])
I have parameters set up in my Main report:
<Subreport Name="subreport2">
<Parameters>
<Parameter Name="FromDateShippedYearMonth">
<Value>= "(" & Code.PreviousYear(Parameters!DateShippedMonth.Value) & ")"</Value>
</Parameter>
<Parameter Name="ToDateShippedYearMonth">
<Value>="(" & Parameters!DateShippedMonth.Value & ")"</Value>
</Parameter>
</Parameters>
And in my Subreport:
<ReportParameter Name="FromDateShippedYearMonth">
<DataType>String</DataType>
<Prompt>FromDateShippedYearMonth</Prompt>
</ReportParameter>
<ReportParameter Name="ToDateShippedYearMonth">
<DataType>String</DataType>
<Prompt>Year - Month</Prompt>
</ReportParameter>
</ReportParameters>
I would like to display data from 12/2006 through 11/2007. Instead I get a list of 1/2006 through 12/2006.
Any ideas?
View 1 Replies
ADVERTISEMENT
Apr 6, 2015
I have 2 tables, one is table A which stores Resources Assign to work for a certain period. The structure is as below
Name StartDate EndDate
Tan 2015-04-01 08:30:00.000 2015-04-01 16:30:00.000
Max 2015-04-01 08:30:00.000 2015-04-01 16:30:00.000
Alan 2015-04-01 16:30:00.000 2015-04-02 00:30:00.000
The table B stores the item process time. The structure is as below
Item ProcessStartDate ProcessEndDate
V 2015-04-01 09:30:10.000 2015-04-01 09:34:45.000
Q 2015-04-01 10:39:01.000 2015-04-01 10:41:11.000
W 2015-04-01 11:44:00.000 2015-04-01 11:46:25.000
A 2015-04-01 16:40:10.000 2015-04-01 16:42:45.000
B 2015-04-01 16:43:01.000 2015-04-01 16:45:11.000
C 2015-04-01 16:47:00.000 2015-04-01 16:49:25.000
I need to select the item which process in 2015-04-01 16:40:00 and 2015-04-01 17:30:00. Beside that I need to know how many resource is assigned to process the item in that period of time. I only has the start date is 2015-04-01 16:40:00 and end date is 2015-04-01 17:30:00. How I can select the data from both tables. There is no need for JOIN, just seperate selections.
Another item process time is in 2015-04-01 10:00:00 and 2015-04-04 11:50:59.
The result expected is
Table A
Name StartDate EndDate
Alan 2015-04-01 16:30:00.000 2015-04-02 00:30:00.000
Table B
Item ProcessStartDate ProcessEndDate
A 2015-04-01 16:30:10.000 2015-04-01 16:32:45.000
B 2015-04-01 16:33:01.000 2015-04-01 16:35:11.000
C 2015-04-01 16:37:00.000 2015-04-02 16:39:25.000
Scenario 2 expected result
Table A
Name StartDate EndDate
Tan 2015-04-01 08:30:00.000 2015-04-01 16:30:00.000
Max 2015-04-01 08:30:00.000 2015-04-01 16:30:00.000
Table B
Item ProcessStartDate ProcessEndDate
Q 2015-04-01 10:39:01.000 2015-04-01 10:41:11.000
W 2015-04-01 11:44:00.000 2015-04-01 11:46:25.000
View 8 Replies
View Related
May 7, 2008
I am doing report development against OLAP (Cube). I have a parameter which is a multi-value parameter, and I need to pass this as a parameter into a sub-report (pass all the values selected in this multi-value from the main report to sub report parameter).
Is this even possible? If yes how do I achieve this.
Currenty I sent like Fields!Region.Value(0), but I want to send actually Fields!Region.Value() (meaning all selected).
Any help ASAP is appreciated.
View 3 Replies
View Related
Dec 9, 2005
Is it possible to pass a multi-value parameter from a master report to one or more subreports? If so, how?
View 12 Replies
View Related
Feb 21, 2007
Hi guys,
I have managed to pass a string parameter form the main report to the subreport with no problems, but when i try and use the same method to pass a datetime type, i am issued with the following error messase:
"[rsErrorExecutingSubreport] An error occurred while executing the subreport €˜SubReportName€™: The value provided for the report parameter 'MasterDate' is not valid for its type."
I cant see why it work for strings, but not for datetime. Any suggestions will be very much appreciated
View 7 Replies
View Related
May 16, 2007
I have two subreports on one master report who's parameters @ReportDate would be set to the same date each time the report is run. When i run the master report i get an error for each report that tells me that one or more parameters required to run the report have not been specified. How do i pass the parameter i want to use in both reports from the master report through to the subreports.
Thanks again!
View 3 Replies
View Related
Mar 9, 2007
I have a multi-valued parameter that I want to pass to a subreport. The values are 11, 12, 13, and 14.
So here's what I've done:
1. For the properties of the clickable field of the first report, I have gone to the Navigation tab and chosen the subreport in the "jump to report" pulldown.
2. Then I clicked on the Parameters button and added a parameter name for the multi-valued parameter I am trying to send. For the Parameter value, I have tried 11,12,13,14. I have also tried =Split(11,12,13,14)
3. On the subreport, I create a report parameter with the same name, data type is string, multi-value is checked, and the available values pulldown is populated by a query.
So I run the first report and click on the link that brings me to the subreport, but all the subreport shows is the results for 11, not 12, 13, and 14.
How can I get the second report to understand that I want it to show all the records related to 11, 12, 13, and 14? If I bypass the first report and simply use the drop-down to choose 11, 12, 13, and 14 in the subreport, it works fine. I just can't seem to figure out how to correctly have the first report tell the subreport that it wants 11, 12, 13, and 14.
Thanks in advance for any advice!
Dan
View 4 Replies
View Related
Sep 21, 2007
I need to convert a Crystal report that contains three subreports. Each of these subreports uses a different stored procedure to obtain data. The main report uses data from these subreports to calculate averages in the footer etc.
How do i get the data contained in these subreports so i can use it in my main report??
Thanks in advance
View 4 Replies
View Related
Aug 16, 2006
I am attempting to write a SQL query that retrieves info processed between two times (ie. 2:00 pm to 6:00 pm) during a date range (ie. 8/1/06 to 8/14/06)... I am new to SQL and am perplexed... I have referenced several texts, but have not found a solution. Even being pointed in the right direction would be greatly appreciated!!
View 6 Replies
View Related
Sep 12, 2007
I have a main report and a subreport. Subreport is not at row level but is at report level. The sub report has a parameter that needs to be passed from mainreport. However, the subreport's parameter should be set and the subreport should be refreshed when the user clicks on a row in mainreport. Can I use drill-through / navigation feature in any way to build this functionality?
Any help will be most appreciated.
View 3 Replies
View Related
Jul 24, 2007
Hello everybody,
I'm trying to pass the values of a subreport matrix to my main report.
For example, I have a matrix subreport like this:
USA CANADA FRANCE GERMANY
Client1Sales $100 $200
Client2Sales $600 $50 $300
What I would like to do is to pass the USA Sales Amount of Client1 (e.g $100) to my main report.
Is there any way to do this?
Thanks in advance for your answers!
Zoz
View 2 Replies
View Related
Sep 6, 2015
I have two reports 'Product Details' and 'Sales by Product'
When i click on 'Product ID' field in 'Product Details' report, It has to drill through to 'Sales by Product' which has a parameter 'Product ID' in it.Â
I have written the following javascript
="javascript:void(window.open('http://servername/Rportserver/Pages/Report.aspx?ItemPath=%2fTestDrillThru%2fSales+By+Product&rs:Command=Render&ChildProductID="& Fields!ProductID.Value &"','_blank',',resizable=1,width=1600,height=800,left=50'))"
When i drill through, field value is not passing to 'child product id' in sales by product. I have to give the value again in child report.
View 5 Replies
View Related
Nov 10, 2015
I have two reports.
1. Main Report
2. Sub Report.
I have cascading parameters in 'Main Report'. When i try to pass cascading parameters in to sub-report, I could pass only 'first parameter' value to sub-report.Is there a way that i can pass cascading parameters to the child report?
View 4 Replies
View Related
Jul 29, 2015
My goal is to select values from the same date range for a month on month view to compare values month over month. I've tried using the date trunc function but I'm not sure what the best way to attack this is. My thoughts are I need to somehow select first day of every month + interval 'x days' (but I don't know the syntax).In other words, I want to see
Select
Jan 1- 23rd
feb 1-23rd
march 1-23rd
april 1-23rd
,value
from
table
View 9 Replies
View Related
Aug 27, 2015
I have a QA Deployment Date field that is being returned in a custom report I created. I also found a sample date range parameter:
What I want to accomplish:
I want to select a From and To Date and filter the report to only display the rows that have the QA Deployment Date within the selected range.
For example.. I want to select From Date (8/1/2105) and To Date (8/31/2015) and I only want to return only the results that have a QA Deployment date between that selected range.
View 3 Replies
View Related
Aug 11, 2013
Date parameter. I created a report that allows a drop down for a date range to be selected. However, whenever I preview the report, I get an error. I know my error stems from my date fields being in this format "201301" , and the "date/ time" in SSRS being mm/dd/yyyy on the drop down calendar in SSRS.
I know the direction I want to go in, but just a little confused on where would I use the convert or cast function. Would it be in the data parameter itself, or a part of the query before the @start date and @End date?
View 18 Replies
View Related
Apr 22, 2015
I would like to be able to search by a single date, @StartDate, or by a date range , between @StartDate and @EndDate. I am having a hard time with the logic on this for a report in SSRS.
View 5 Replies
View Related
Jul 29, 2015
I have two report , first is main report which is matrix and have one parameter User_ids which is multi value selection and my second report is basic chart of user_wise performance.
Now, my main report (matrix ) works fine for Multiple selection of users and i have putted one textbox on main report chart which has action properties set for chart report, when user click on chart button it must goes to chart with user selected in main report. Now , i have used expression for parameter to send it like ..
=join(parameter!user_id!value,",") which pass selected value to chartÂ
And when I am selecting single user it passing that value to chart parameter list but , when it is more than one user it errors with conversion failed when converting the nvarchar value '121,128' to data type int. But my chart also works when passing 121,128 in user parameter in preview of report .
View 2 Replies
View Related
Sep 28, 2012
I have to display the last temperature reading from an activity table for all the dates in a selected date range.So if I select the date range from 09/01/2012 to 09/30/2012, the results should look like this:
Date Temperature
09/01/2012 73.5
09/02/2012 75.2
09/03/2012 76.3
09/04/2012 73.3
09/05/2012 77.0
09/06/2012 74.5
and so on.
I am using this to get the dates listed:
WITH CTE_DatesTable
AS
(
SELECT CAST('20120901' as date) AS [Date]
UNION ALL
SELECT DATEADD(dd, 1, [Date])
FROM CTE_DatesTable
WHERE DATEADD(dd, 1, [Date]) <= '20120930'
)
SELECT [Date]
FROM CTE_DatesTable
How could I get the temperature if I did a sub-query here?
View 5 Replies
View Related
Jan 23, 2007
I have a report that I need to run on 2 different date ranges.
Both report's data is 2 days behind today's date.
so...
WHERE reportdate between dateadd('d',date(),-2) and dateadd('d',date(),-2)
OR SOMETHING LIKE THAT, NO BIGGIE HERE
The 2nd report is a month to date report. This is the 1 I can't figure out.
WHERE reportdate between (the first day of this month) and dateadd('d',date(),-2)
So that would look like
WHERE reportdate between 1/1/2007 and 1/21/2007
My problem is, if today is the 1st day of the month... how can I get my critiera to NOT do this
WHERE reportdaye between 2/1/2007 and 1/30/2007
Any help would be greatly appriciated!
View 2 Replies
View Related
Jul 23, 2005
Hi Group!I am struggling with a problem of giving a date range given the startdate.Here is my example, I would need to get all the accounts opened betweeneach month end and the first 5 days of the next month. For example, inthe table created below, I would need accounts opened between'5/31/2005' and '6/05/2005'. And my query is not working. Can anyonehelp me out? Thanks a lot!create table a(person_id int,account int,open_date smalldatetime)insert into a values(1,100001,'5/31/2005')insert into a values(1,200001,'5/31/2005')insert into a values(2,100002,'6/02/2005')insert into a values(3,100003,'6/02/2005')insert into a values(4,100004,'4/30/2004')insert into a values(4,200002,'4/30/2004')--my query--Select *[color=blue]>From a[/color]Where open_date between '5/31/2005' and ('5/31/2005'+5)
View 2 Replies
View Related
Jul 26, 2007
Have seen other questions here about modifying date pickers supplied by reports created in BIDS. The answer is usually NO. But this does not involve a format change, simply want to limit say to a specific year.
Any ideas?
View 4 Replies
View Related
Oct 25, 2007
Hi;
We received a Payment from a customer on '10/10/2007 10:30:00'. i am trying to calculate the commission we would receive from that payment. the commission rate can be edited. so i have to find what the commission rate was when that payment was received.
I have a CommisionAudit table that tracks changes in commission rate with the following values.
ID | Commission Change | UpdatedOn
----------------------------------------------
1 | Change from 20->25 | 03/07/2007 09:00:00
----------------------------------------------
2 | Change from 25->35 | 10/09/2007 17:00:00
----------------------------------------------
3 | Change from 35->20 | 01/10/2007 16:00:00
----------------------------------------------
4 | Change from 20->26 | 11/10/2007 10:00:00
----------------------------------------------
with this payment, as the commission rate had been changed on 01/10/2007 it would obviously be 20%(ID 3). But I need to write sql to cover all eventualities i.e. Before the first and after the last. any help would be most welcome.
View 11 Replies
View Related
Nov 3, 2015
I am trying to create a report with a sub report in Sql Server 2012 using Report Builder Version 3. Â I can run the subreport without any problems. Â I read where using a shared connection can cause this error so both the main report and the subreport use a connection that is embedded in my report. Â
For testing, I created the subreport without a parameter and added it to the main report. Â When I ran it that way, the report worked and sub report displayed the data. Â So I know it can read from the database.It seems to only give me this error when I am trying to tie the two reports together using a parameter. Â
View 2 Replies
View Related
Jul 14, 2015
Using SSRS 2014 and VS2013 rc5.
How do I hide a subreport if the parent report row containing the subreport is a certain value? I am attempting to create a statement with ageing buckets. In the main body of the report I have to display payments and invoices. If the invoice row is blank, I need to hide the row containing the subreport.
First, Is this even possible?
Second, How?
View 10 Replies
View Related
Dec 16, 2006
Hi,
I have a report which contains a subreport placed inside a list. when the subreport returns no data. it appears as a blank space in the main report. So i want to suppress the list when the subreport returns no data. Can somebody help me with this?
thanks
shri
View 1 Replies
View Related
Aug 30, 2007
I have a order table which has a orderdate and despatchdate
i want to write a query in such a way that i want to get all the details from the table for a range specified date as the oderdate and despatchdate are user
interactable. I search the google to solve this problem but could not find a answer
View 10 Replies
View Related
Jan 14, 2005
What is the best way to do a where clause that includes a date range. Ex. WHERE date1 BETWEEN @Begin Date AND @EndDate. I want to include all of the @EndDate.
View 6 Replies
View Related
Aug 9, 2007
I am working on a report for staff productivity, and have to get a summary figure for how much productivity was expected for a date range. The problem is that the amount expected from an employee can change if they move from full time to part time etc.
So I have a view that has the begin date, end date, expected daily production # by employee, and have to figure out how to get the multiplication to work correctly.
Example:
Employee 1 had a daily production # of 10 from 1/1/07-3/31/07 and daily production of 5 from 4/1/07 - now
If I run the production report for 1/1/07 - 6/30/07 what I want is one summary figure of for the entire range which would be 10*Datediff(d,1/1/07,3/31/07)+5*Datediff(4/1/07,6/30/07) or 890+450=1340.
Of course the actual date range for the report will be a variable, and the dates for the begin and end of a production date range will be all over the place.
Any quick and easy way to do this?
View 4 Replies
View Related
Apr 7, 2008
Hey guys..
pls help
what query should I do? Obtaining certain date only using SQL server2000?
Thnx...
View 4 Replies
View Related
Jun 18, 2006
Hi All,
I am very new to SQL and have a question, hopefully someone can answer.
I have a table of data, one of the fields is a date.
What i want to do is be able to have a query that can check if the date falls within a certain range - ie fiscal year and output in another column the fiscal year "code".
Ie: dates between 01/06/05 and 31/05/06 is fiscal year 0506
dates between 01/06/06 and 31/05/07 is fiscal year 0607
Could this query be dynamic so if a new fiscal year begins it would know to make the output the next fiscal year code???
Any help is much appreciated.
Cheers
Rudi
View 8 Replies
View Related
Oct 2, 2006
Hi, 'am fairly very new to SQL SERVER 2000.
I have this particular problem....I need to develop a stored proc
where in a parameter checks the dates between JAN 1st and DEC 31st of a particular year. The parameter is declared for year..
I'll mention a small example below...
USE PUBS
declare @year as varchar
set @year = 1993
select * from employee
where hire_date >= '@year-01-01'
and hire_date<='@year-12-31'
This is just an example to show wat i want...
the year is prompted to the user...he/she can select any year
I get the following error message....
Server: Msg 241, Level 16, State 1, Line 1
Syntax error converting datetime from character string.
Can anyone help me on this......
Thanks in advance
View 9 Replies
View Related
Mar 12, 2008
How to display start date and finish date together in the same column with a '-' in between?
2/24/2008 - 3/1/2008
View 3 Replies
View Related