Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: group by for column of type date
Alex Filonov wrote:
[..]
>
> TRUNC (date function) does not depend on locale settings. It just
> truncates the date. Here's function definition from 8.1.7 and 9.2.0.1
> SQL language reference:
>
> TRUNC returns d with the time portion of the day truncated to the
> unit specified by the format model fmt. If you omit fmt, d is
> truncated to the nearest day.
>
> I don't see anything about locale settings here. It might be locale
> specific when you truncate to week, month, year etc., but I don't see
> how it can be locale specific when truncates to the day.
a short test shows:
create table date_test (t date);
insert into date_test select sysdate from dual;
now using a german database (NLS_LANG=german_germany.WE8DEC)
SQL> select trunc(t) from date_test;
TRUNC(T)
now using an american database (NLS_LANG=AMERICAN_AMERICA.WE8DEC)
SQL> select trunc(t) from date_test;
TRUNC(T)
> TO_CHAR converts date into string. Which can be locale specific, even
> with specified format.
[...]
-- mac real email-adress: mac clondiag comReceived on Wed Nov 27 2002 - 06:38:47 CST
![]() |
![]() |