Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: group by for column of type date

Re: group by for column of type date

From: Michael Howitz <mhowitz_at_firemail.de>
Date: Tue, 26 Nov 2002 10:45:05 +0100
Message-ID: <3DE342A1.3080104@firemail.de>


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 com
Received on Tue Nov 26 2002 - 03:45:05 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US