Skip to content

BQ datetime_trunc #58

@tiboun

Description

@tiboun

Translating

SELECT
    DATETIME '2008-12-25 15:30:00' as original,
        DATETIME_TRUNC(DATETIME '2008-12-25 15:30:00', DAY) as truncated;

returns

SELECT DATETIME '2008-12-25 15:30:00' AS original, DATE_TRUNC('DAY', DATETIME '2008-12-25 15:30:00') AS truncated

which results as a date once date_trunc is applied. date_trunc returns either a timestamp or a date depending on the granularity provided. Maybe we should transform it to a datetime once done if bigquery function is datetime_trunc

SELECT DATETIME '2008-12-25 15:30:00' AS original, DATE_TRUNC('DAY', DATETIME '2008-12-25 15:30:00')::DATETIME AS truncated

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions