View Single Post
  #15 (permalink)  
Old 07-07-09, 08:53
beilstwh beilstwh is offline
Lead Application Develope
 
Join Date: Jun 2004
Location: Liverpool, NY USA
Posts: 2,219
trunc('01-02-2009') ONLY works because your NLS_DATE format is mm-dd-yyyy. At my site it is dd-mon-rr. Do not get into the habit of relying on the NLS settings, if it changes or the software is at another site it will always fail. Use

to_date('01-02-2009','mm-dd-yyyy')

Because the trunc is expecting a date, it implicitly converts the string to a date and then truncs it. A very bad habit to get into.
__________________
Bill
You do not need a parachute to skydive. You only need a parachute to skydive twice.
Reply With Quote