Menu

date_trunc in GBase 8a: Truncating a Date to a Chosen Precision
📰

date_trunc in GBase 8a: Truncating a Date to a Chosen Precision

DEV Community: sql·Michael·2 days ago
#13HL3aXv
#devtosql#devto#dev#date_trunc#gbase
Long article (725 words) — no AI summary yet.
Reading 0:00
15s threshold

date_trunc cuts off every part of a date below a given precision. This post walks through all supported type values for the China-domestically developed GBase 8a MPP database from GBASE, with the original output of each example.

Reference

The companion note on the date_part and extract date functions.

Syntax

date_trunc ( type , date )

Enter fullscreen mode

Exit fullscreen mode

type : the precision position to truncate at; everything below it is cut off.

date : normally a datetime; a date value is converted to datetime automatically.

type accepts both the quoted and unquoted forms, for example year and 'year' .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.