May 19, 2012  
   Login  
Forum  
 
ForumForumEnesys RS Data ...Enesys RS Data ...Support - RS Da...Support - RS Da...blank date parametersblank date parameters
Previous Previous
 
Next Next
New Post
 6/18/2009 6:31 AM
 
I had a 2 date fields to be used in the report's dropdown parameters. This parameter is used to indicate the start date and the end date. For example I want the report to generate data from 10/6/2009 until 20/6/2009. It do generate result from start date to end date.

How about if I want to leave both parameters in blank and it will show me all the data instead? Or I can leave one of the date parameter as blank.

For example I will leave the start date parameter as blank and fill up the end date as 20/6/2009. I want the result to show all data from the 1st day until 20/6/2009.
~ Or ~
I will fill up the start date as 10/6/2009 and leave the end date parameter as blank. I want the result to show all data from 10/6/2009 until the last day.

Is there any workaround in term of query?
New Post
 6/19/2009 3:31 PM
 

Hi,

The first problem you will be facing has to do with SSRS which does not accept blank dates. Therefore, you would have to accept to check NULL instead of leaving a blank date.

image

 

You could use two internal SSRS date parameters in addition to the 2 dates parameters available when running the report.

image

hStarDate internal parameter would be initialized by using the following expression:

=IIF(IsNothing(Parameters!StartDate.Value), DateSerial(1900,01,01), Parameters!StartDate.Value)

image

hEndDate internal parameter would be initialized by using the following expression:

=IIF(IsNothing(Parameters!EndDate.Value), DateSerial(4000,01,01), Parameters!EndDate.Value)

 

Your query will be using the internal parameters as shown in the following image:

image

Hope this helps,

Regards,


Frederic LATOUR
ENESYS
Previous Previous
 
Next Next
ForumForumEnesys RS Data ...Enesys RS Data ...Support - RS Da...Support - RS Da...blank date parametersblank date parameters

 
You need to login for posting to the forums.
If you don't have a login, click here to register.
 
Copyright 2010 Enesys - All rights reserved Terms Of UsePrivacy Statement