DATEFROMSTRING(A,B)
- 1 Minute to read
- Print
- DarkLight
- PDF
DATEFROMSTRING(A,B)
- 1 Minute to read
- Print
- DarkLight
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
String: DateFromString(A,B)
Produce a date field from a date stored as string
Purpose
Use this function to:
- Convert Dates loaded as strings into Date fields
- Create Date fields after loading unknown date columns as strings for inspection and review
Return Value
Property | Value |
---|---|
FieldType | Date |
FieldSize | Low / Med |
DataType | Discrete |
DataSize | Integer |
Example Return Value: 1974-02-19
Parameters
Parameter | JSON | Description |
---|---|---|
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. |
Function | "function":"String" | String |
String Function | “p1”: “DATEFROMSTRING(A,B)” | DATEFROMSTRING(A,B) |
A | “p2”: | Required. The string field containing the date string Supports:
|
B | “p3”: | Required. The format of the data in the source string field Supports:
|
Treat Null as Zero | "nullIsZero": true "nullIsZero": false | True/False. Default = False If true, then any null values in the input fields will be treated as if they have a value of 0. |
JSON Sample
{
"method": "BuildBakedField",
"project": "BikeData2",
"targetTable": "BikeTripData",
"overwrite": true,
"name": "dt_start_date",
"function": "string",
"p1": "DATEFROMSTRING(A,B)",
"p2": "str_start_date",
"p3": "#YYYY-MM-DD"
}
Usage Notes
Convert date values stored in STRING field into a native DATE field
Inputs:
- Field A is the string date
- Field B is the string date format
Date Formats:
- #YYYY-MM-DD
- #YYYYMMDD
- #MM-DD-YYYY
- #MMDDYYYY
- #DD-MM-YYYY
- #DDMMYYYY
See Also:
- Engineering | Expression Field
Example
Example | Details |
---|---|
Description | Create date field from date loaded as a string |
Input |
|
Sample |
Was this article helpful?