timestamp for minimum and maximum value

Rahul Indore 21 Reputation points
2021-02-26T09:22:51.293+00:00

Hello,

I am using report builder 2.0. From the logged entries in column I can able to get Min and Max values by expression Min(Fields!Value.Value) and Max(Fields!VALUE.Value). I need to find out timestamp for Min and Max value in a different column. How can I achieve it?

Thanks & Regards,
Rahul

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
3,061 questions
0 comments No comments
{count} votes

Accepted answer
  1. ZoeHui-MSFT 41,491 Reputation points
    2021-03-03T08:19:17.913+00:00

    Hi @Rahul Indore

    If you want to show the value of the timestamp, I'd like to suggest that you may process the data with t-sql before designing the report.

    The code may like:

    SELECT DISTINCT (SELECT DATE FROM yourtable  
      WHERE VALUE=(SELECT MIN(VALUE) FROM yourtable)) MINVALUEDATE,  
      (SELECT DATE FROM yourtable  
      WHERE  VALUE=(SELECT MAX( VALUE) FROM yourtable)) MAX VALUEDATE  
      FROM yourtable  
    

    Regards,

    Zoe

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. ZoeHui-MSFT 41,491 Reputation points
    2021-03-01T02:36:48.767+00:00

    Hi @Rahul Indore ,

    Set the textbox of the Min and Max value with name of 'MIN' and 'MAX' like shown.

    72738-screenshot-2021-03-01-101947.jpg

    And then in the timestamp column use the expression to highlight the timestamp of the max and min value.

    =Switch(Fields!price.Value=reportitems!MAX.value,"Red",Fields!price.Value=reportitems!MIN.value,"DarkGreen",Fields!price.Value<reportitems!MAX.value OR Fields!price.Value>reportitems!MIN.value,nothing)  
    

    Here is a sample preview for your reference:

    72804-screenshot-2021-03-01-102918.jpg

    If you want to show the value of the timestamp, I'd like to suggest that you may process the data with t-sql before designing the report.

    If I misunderstand your meaning, please incorrect me.

    Regards,

    Zoe


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
    Hot issues October


  2. Rahul Indore 21 Reputation points
    2021-03-02T09:38:53.677+00:00

    Hi,

    Thanks for your valuable feedback.

    Actually I want to show the value and timestamp of minimum value and maximum value.
    Find attached screenshot I want to show Minimum Value as 16 and its corresponding timestamp i.e. 02-03-2021 10:0473391-values.png
    and maximum Value as 125 and its corresponding timestamp i.e. 02-03-2021 10:05.

    Thanks & Regards,
    Rahul


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.