If I'm truncating a date to 'month', is because I want a date with
'integer-months'.
Just like if I truncated a number to 'integer' - I get an integer
number, isn't it?

See also:
http://www.redhat.com/docs/manuals/database/RHDB-7.1.3-Manual/sql/functions-datetime.html#FUNCTIONS-DATETIME-TRUNC
 [...] 
 The return value is of type timestamp with all fields that are less
than the selected one set to zero (or one
 [...]
 SELECT date_trunc('hour', TIMESTAMP '2001-02-16 20:38:40');
 Result: 2001-02-16 20:00:00+00

 SELECT date_trunc('year', TIMESTAMP '2001-02-16 20:38:40');
 Result: 2001-01-01 00:00:00+00

- Flávio S. Glock

Reply via email to