Go Back
Date Transformation - SQL Function Examples
Publisher
:
Run In Lingk
Description
This recipe demonstrates how to use a variety of different SQL based date functions that can be utilized for Date transformations.
Browse the knowledge base
Twitter
E-Mail
# _____ _ _____ __ # | __ \ (_) |_ _| / _| # | |__) |___ ___ _ _ __ ___ | | _ __ | |_ ___ # | _ // _ \/ __| | '_ \ / _ \ | | | '_ \| _/ _ \ # | | \ \ __/ (__| | |_) | __/ _| |_| | | | || (_) | # |_| \_\___|\___|_| .__/ \___| |_____|_| |_|_| \___/ # | | # |_| # Project Name - Date Transformation - SQL Function Examples # Recipe URL - https://app.lingk.io/a/10932/tf/18552 # Description - This recipe demonstrates how to use a variety of different SQL based date functions that can be utilized for Date transformations. # Systems - # Connectors - JSON # Data Flows - Single Direction # Connection Type - Data # Add Recipe notes / Change log information here! # _____ _ # / ____| | | # | | ___ _ __ _ __ ___ ___| |_ ___ _ __ ___ # | | / _ \| '_ \| '_ \ / _ \/ __| __/ _ \| '__/ __| # | |___| (_) | | | | | | | __/ (__| || (_) | | \__ \ # \_____\___/|_| |_|_| |_|\___|\___|\__\___/|_| |___/ # # CONNECTORS specify what data will be pulled into the in-memory database during processing connectors: # Configure JSON connector in your Environment before running this recipe # JSON Setup - https://help.lingk.io/en/articles/74-json-connector-reference # Source data - name: placeholder type: json properties: jsonObject: "[]" # _____ _ _ _ # / ____| | | | | | # | (___ | |_ __ _| |_ ___ _ __ ___ ___ _ __ | |_ ___ # \___ \| __/ _` | __/ _ \ '_ ` _ \ / _ \ '_ \| __/ __| # ____) | || (_| | || __/ | | | | | __/ | | | |_\__ \ # |_____/ \__\__,_|\__\___|_| |_| |_|\___|_| |_|\__|___/ # STATEMENTS specify how the data should be processed while in memory statements: ## to_date: # convert a string a date object ## to_timestamp: # convert a string a timestamp object ## date_format: #takes a date object and converts to a different format - statement: | (dates) => select date_format(to_date("01/18/99", 'fd/dd/yy'), 'yyyy-MM-dd'), to_date("01/18/99", 'MM/dd/yy'), to_date('2009-07-30 04:17:52'), to_date('2016-12-31', 'yyyy-MM-dd'), to_timestamp('2016-12-31', 'yyyy-MM-dd'), date_format(to_date("01/18/99", 'MM/dd/yy'), 'yyyy-MM-dd'), date_format(to_date("2009-07-30 04:17:52"), 'EEE MMM dd HH:mm:ss zzz yyyy'), date_format(current_timestamp(), 'EEE MMM dd HH:mm:ss zzz yyyy'), date_format(current_timestamp(), "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") - statement: print dates # Add more statements to convert, join, aggregrate, transform, and integrate your data
Canvas Catalog Reader
Update an Environment Variable in a Recipe