EXTRACT clauses

The
EXTRACT
clause extracts a Date/Time component from a DateTime type column.

Supported functionality

Examples of supported EXTRACT functionality
Expected behavior
Query to achieve the expected behavior
Extract the day component from a DateTime column.
SELECT EXTRACT(DAY FROM Time) AS "Day" FROM Table1;
Extract the year component from a DateTime column.
SELECT EXTRACT(YEAR FROM Time) AS "Year" FROM Table1;
Extract the month component from a DateTime column.
SELECT EXTRACT(MONTH FROM Time) AS "Month" FROM Table1;
Extract the hour component from a DateTime column.
SELECT EXTRACT(HOUR FROM Time) AS "Hour" FROM Table1;
Extract the minute component from a DateTime column.
SELECT EXTRACT(MINUTE FROM Time) AS "Minute" FROM Table1;
Extract the second component from a DateTime column.
SELECT EXTRACT(SECOND FROM Time) AS "Second" FROM Table1;
Filter rows by year using EXTRACT.
SELECT * FROM "DataLogger1" WHERE EXTRACT(YEAR FROM Timestamp) = "2025";

Unsupported functionality

  • Using EXTRACT directly in GROUP BY clauses.
  • Casting extracted values to other data types.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal