MINSDIFF(A,B)
  • 1 Minute to read
  • Dark
    Light
  • PDF

MINSDIFF(A,B)

  • Dark
    Light
  • PDF

Article summary

DateTime Transform: MINSDIFF(A,B)

Returns difference in minutes between Time for DateTime A and Time for DateTime B

MINSDIFF(A,B) = AbsoluteMinutes(B) - AbsoluteMinutes(A)

Where

  • AbsoluteMinutes(B) = number of minutes from date reference (where date reference = Jan 0, 0000) to B
  • AbsoluteMinutes(A) = number of minutes from date reference (where date reference = Jan 0, 0000) to A


Purpose

Use this function to:
  • Calculate time between events down to the minute
  • Calculate the age of an event in minutes

Return Value

PropertyValue
FieldTypeInteger
FieldSizeMed / High
DataTypeDiscrete / Continuous
DataSizeShort / Integer


Example Return Value: -N....N where N = maximum difference in minutes between A and B

Parameters

ParameterJSONDescription
Table“targetTable”: “MyTableName”The target table on which the new field will be created
Filter“dataset”: {DataSet_JSON}Optional.   If a filter is applied, records not in the filter Recordset will be returned as null.
DateTime Function“p1”: “MINSDIFF(A,B)”MINSDIFF(A,B)
A“p2”: “DateTimeFieldName”
“p2”: “#YYYY-MM-DD HH:MM:SS”
Required. DateTime Value for A
Supports:  
  • DataType: Continuous
  • Field Type:  DateTime
  • Fixed Value:  #YYYY-MM-DD HH:MM:SS,    e.g. #2021-04-05 11:01:08
B“p3”: “DateTimeFieldName”
“p3”: “#YYYY-MM-DD HH:MM:SS”
Required. DateTime Value for B
Supports:  
  • DataType:  Continuous
  • Field Type: DateTime
  • Fixed Value:  #YYYY-MM-DD HH:MM:SS,    e.g. #2021-04-05 11:01:08

JSON Sample

Usage Notes

{Insert Notes Here}

Example

ExampleDetails
DescriptionCalculate number of minutes between purchase and shipping
Input
  • Table: = [transactions]
  • Function: = DateTimeTransform
  • DateTimeFunction: = MINSDIFF(A,B)
  • A:= [transactions].[dtPurchase]
  • B: = [transactions].[dtShipping] 
  • Name: =ShippingTime_Mins
Sample



Was this article helpful?

What's Next