How to display date time in Parameters?

Hi,

I have 2 date time parameters From Date andd To Date. They are displayed as below

From Date  02/01/2015

To Date  02/01/2015

What i want is when From Date and To Date are same, then the To Date should be displayed as below

To Date  02/01/2015  23:59.59

Can you sugggest how to accompish this?

Regards

February 3rd, 2015 10:40pm

For this we can 3 parameters i.e FromDate, ToDate and ToDateTemp

1. FromDate parameter : Datatype is datetime, Visiblity is set and no available values and default value set.
2. ToDate parameter : Datatype is datetime, Visibility is set and no available values and default values set.

3. ToDateTemp parameter : Datatype is text, Available values need to select "Specify values" and set the label and value expression as,

=IIF(FormatDateTime(Parameters!FromDate.Value)=FormatDateTime(Parameters!ToDate.Value), FormatDateTime(Parameters!FromDate.Value,DateFormat.ShortDate) + " 23:59.59", FormatDateTime(Parameters!ToDate.Value))

Similarly for Default Values, Select "Specify Values" and set the value expression as,
=IIF(FormatDateTime(Parameters!FromDate.Value)=FormatDateTime(Parameters!ToDate.Value), FormatDateTime(Parameters!FromDate.Value,DateFormat.ShortDate) + " 23:59.59", FormatDateTime(Parameters!ToDate.Value))

We can specify the 3rd parameter's visibility as hidden.

Free Windows Admin Tool Kit Click here and download it now
February 4th, 2015 12:11am

if its sql you can do like this

SELECT @FromDate AS FromDate,
CASE WHEN @FromDate = @ToDate THEN DATEADD(mi,86399,@ToDate) ELSE @ToDate END AS ToDate

in ssrs you need this

=IIF(CDate(Fields!ToDate.Value) = CDate(Fields!FromDate.Value), DateADd(DateInterval.Minute,86399,CDate(Fields!ToDate.Value)),CDate(Fields!ToDate.Value))

February 4th, 2015 4:25am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics