mht_brerp10
.adempiere
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
trunc(timestamp without time zone, character varying)
Parameters
Name
Type
Mode
datetime
timestamp without time zone
IN
format
character varying
IN
Definition
BEGIN IF format = 'Q' THEN RETURN CAST(DATE_Trunc('quarter',datetime) as DATE); ELSIF format = 'Y' or format = 'YEAR' THEN RETURN CAST(DATE_Trunc('year',datetime) as DATE); ELSIF format = 'MM' or format = 'MONTH' THEN RETURN CAST(DATE_Trunc('month',datetime) as DATE); ELSIF format = 'DD' THEN RETURN CAST(DATE_Trunc('day',datetime) as DATE); ELSIF format = 'DY' THEN RETURN CAST(DATE_Trunc('day',datetime) as DATE); ELSE RETURN CAST(datetime AS DATE); END IF; END;