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

DATEFROM(A,B,C)

  • Dark
    Light
  • PDF

Article summary

Date Transform: DATEFROM(A,B,C)

Create a Date Field from Year(A), Month(B) and Day(C)

Purpose

Use this function to:
  • Construct date fields from integer parts

Return Value

PropertyValue
FieldTypeDate
FieldSizeMed
DataTypeDiscrete
DataSizeShort


Example Return Value:  2019-05-08

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.
DateTimeFunction“p1”: “DATEFROM(A,B,C)”DATEFROM(A,B,C)
A“p2”: “YearFieldName”
“p2”: “#YYYY”
Required.   Integer value specifying the year component of a date.
Supports:  
  • DataType: Discrete 
  • Field Type: Integer
  • Fixed Value:  #YYYY  e.g. #2021
B“p3”: “MonthFieldName”
“p3”: “#MM”
Required.   Integer value specifying the year component of a date.
Supports:  
  • DataType: Discrete 
  • Field Type: Integer
  • Fixed Value:  #MM e.g. #12
C“p4”: “DayFieldName”
“p4”: “#DD”
Required.   Integer value specifying the year component of a date.
Supports:  
  • DataType: Discrete 
  • Field Type: Integer
  • Fixed Value:  #DD e.g. #17

JSON Sample

Usage Notes

A mixture of FIXED_VALUES and Database fields can be used to create the new date field.

Date fields can also be created from strings using the DateFromString function.

Example

ExampleDetails
DescriptionCreate a random date field
Input
  • Table: = [transactions]
  • Function: = DateTransform
  • DateTimeFunction: = DATEFROM(A,B,C)
  • A:= [transactions].[year]
  • B: = [transactions].[Random_Month2] 
  • C: = [transactions].[Random_Day2] 
  • Name: = Random_Date
Sample



Was this article helpful?

What's Next