Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ssrs 2005: sub report date issue

Posted on 2012-03-23
8
Medium Priority
?
490 Views
Last Modified: 2012-04-01
hi all

i have an ssrs report where i pass two date variables 1) date_from 2)date_to

the parameters work fine on the dashboard home page, but when i access a sub report from a graph etc they return no data..

if i take one of the dates out it returns as expected..

eg a basic example of one of the subreport data is

select (case when owneraccount is null then updatedby else owneraccount end)as owneraccount  ,cast(convert(char(11), addeddate, 111) as datetime)as addeddate,
Departmentname ,servicereqno,SubCategory,state

from dbo.q_incidents

where owneraccount = @owner
and addeddate >=  @date_from
and addeddate <=  @Date_To

Open in new window


i have linked both the date parameters to the same date field action part of the graph
and if i run the query simply from data section it also returns the correct information!
am i doing something silly? its been a long week!! :)
0
Comment
Question by:malraff
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 
LVL 29

Expert Comment

by:sammySeltzer
ID: 37757552
You probably have done this already but on the subreport, you need to make sure that your 2 date params are defined.

For instance, i am sure you built the report first before adding it to your main report.

So, on the sub report, you click on Reports (at top of page), click parameters.

On the parameters screen, check to see that your date params are there.

If they are, make sure their data types are datetime, not String.

If they are not, to the left of the screen, Click the Add button to add your date parameters.

Lot of times, they are not added automatically.
0
 

Author Comment

by:malraff
ID: 37757576
yea i have both added as datetimes, and they both exist on the subreport as well

it really should just work as far as i see
0
 
LVL 29

Expert Comment

by:sammySeltzer
ID: 37757606
just for kicks, can you try:

and addeddate between  @date_from and  @Date_To

Open in new window

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:malraff
ID: 37757615
tried that also sammy! same issue
0
 
LVL 29

Expert Comment

by:sammySeltzer
ID: 37757743
Only other thing I can think of is to cast all the date params:

and cast(convert(char(11), addeddate, 111) >=  cast(convert(char(11), @date_from, 111)
and cast(convert(char(11), addeddate, 111) <=  cast(convert(char(11), @Date_To, 111)

Open in new window

0
 

Author Comment

by:malraff
ID: 37757891
i see the issue!

i set the parameters  to viewable on the subreport

and for some reason it is showing the "date_to" value to be the same as the "Date_from"


-- strange, i dont see how they are getting mixed up!
0
 

Accepted Solution

by:
malraff earned 0 total points
ID: 37770549
i got a way around it

when assigning the date_to in the action of the chart i assign it as =last(Fields!addeddate.Value) which gives me the last date entry for the selection
0
 

Author Closing Comment

by:malraff
ID: 37792596
solved it myself
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question