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 is more efficient. It just truncates the date, when TO_CHAR also
> converts it into the string. You also completely insure yourself against
> date conversion problems. For example, if you order by date converted
> to 'YYYY-MM-DD', you are OK most of the time. If you use 'YY-MM-DD',
> results are completely wrong if you have dates it 2 different centuries.
> You wouldn't believe how many statements I modified for Y2K compliance
> because they used conversion with 'YY-MM-DD' mask.
but TRUNC has the problem that it depends on the locale-settings. my software should work with different locale settings & i have also to use date-conversion in the host-language (PHP4). so if the locale changes i don't know how to reflect this change in php-code. the only way would be to do all date-conversion using oracle, but this is not really good because it is too oracle specific & my application should also be able to use another database instead.
-- mac real email-adress: mac clondiag comReceived on Tue Nov 26 2002 - 03:45:05 CST
![]() |
![]() |