How do I convert this to ssrs formula?

REGINA LONG 1 Reputation point
2022-12-09T16:07:08.143+00:00

//Calculates ordered to resulted average timespan for one order
If Not IsNull({ORDER_PROC_child.ORDER_TIME})
and Not IsNull({ORDER_PROC_child.RESULT_TIME})
and {ORDER_PROC_child.ORDER_TIME}<={ORDER_PROC_child.RESULT_TIME}
then DateDiff("s",{ORDER_PROC_child.ORDER_TIME},{ORDER_PROC_child.RESULT_TIME})
Else {@Null Number}

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,058 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2022-12-12T02:59:01.013+00:00

    Hi @REGINA LONG
    Your original expression seems to be a crystal report expression. I don't know much about Crystal Reports. I don't quite understand the @Null Number in the original expression. Does it return nothing? I wrote the following expression based on my understanding:

    =IIf(IsNothing(Fields!ORDER_TIME.Value),nothing,IIf(IsNothing(Fields!RESULT_TIME.Value),nothing,IIf(Fields!ORDER_TIME.Value<=Fields!RESULT_TIME.Value,DateDiff("s",Fields!ORDER_TIME.Value,Fields!RESULT_TIME.Value),nothing)))  
    

    Preview:
    269445-1.png

    Best regards,
    Aniya

    0 comments No comments

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.