I am trying to write a formula to:
1. Calculate the diff between times and display in minutes (but only when the times in question are on the same date)
2. Return a text message when there is no previous time on the day in question.
Fields being calculated:
{V_NI_RECORD.OR_TIME_STOP} using a function to get the previous OR_TIME_STOP with 'Previous({V_NI_RECORD.OR_TIME_STOP})' which I have called {@previous stop time}
{V_NI_RECORD.OR_TIME_START}
Now I have a datediff function (which I have called {@Turn Over}) calculating the difference between OR_STOP_TIME and OR_START_TIME and that works fine except when the previous OR_STOP_TIME is a different date.
I am trying to write a statement in basic syntax and this is what I have so far:
\Dim ORDate As Datetime
ORDate = {V_NI_RECORD.OR_TIME_START}
Dim message As String
If ORDate <= {@previous stop time} Then
message = "No Previous Case"
ElseIf ORDate >= {@previous stop time} Then
formula = {@Turn Over}
End IF
When I use this, the instances where "No Previous Case" should be displayed gives me "0.00" instead
Is there something I am missing?
Thank you
1. Calculate the diff between times and display in minutes (but only when the times in question are on the same date)
2. Return a text message when there is no previous time on the day in question.
Fields being calculated:
{V_NI_RECORD.OR_TIME_STOP} using a function to get the previous OR_TIME_STOP with 'Previous({V_NI_RECORD.OR_TIME_STOP})' which I have called {@previous stop time}
{V_NI_RECORD.OR_TIME_START}
Now I have a datediff function (which I have called {@Turn Over}) calculating the difference between OR_STOP_TIME and OR_START_TIME and that works fine except when the previous OR_STOP_TIME is a different date.
I am trying to write a statement in basic syntax and this is what I have so far:
\Dim ORDate As Datetime
ORDate = {V_NI_RECORD.OR_TIME_START}
Dim message As String
If ORDate <= {@previous stop time} Then
message = "No Previous Case"
ElseIf ORDate >= {@previous stop time} Then
formula = {@Turn Over}
End IF
When I use this, the instances where "No Previous Case" should be displayed gives me "0.00" instead
Is there something I am missing?
Thank you