home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.oracle      Overblown overpriced overengineered SHIT      2,288 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 2,019 of 2,288   
   .com to All   
   Re: format date with Oracle Dynamic SQL   
   02 Mar 05 04:25:45   
   
   From: mcstockX@Xenquery   
      
    wrote in message   
   news:1109731580.120769.164910@g14g2000cwa.googlegroups.com...   
   > sorry about bothering you, but when i do something like   
   >   
   > select to_date(to_char(date_column, 'yyyy-mm-dd hh24:mi:ss'),   
   > 'yyyy-mm-dd hh24:mi:ss') from table_name   
   >   
   > in my pro*c code, i get back   
   >   
   > 2005-02-24 00:00:00   
   >   
   > when  data is 2005-02-24 11:05:07   
   >   
      
   the TO_DATE is using the default date format (NLS_DATE_FORMAT) to convert   
   back to a date column -- that is likely truncating the time element   
      
   if you want a date, don't use either to_date or to_char   
      
   if you need to convert to or from a date datatype, us to_date or to_char   
   (seldom are both ever used together) with the appropirate date format -- or   
   use ALTER SESSION to set the default date format for your session   
      
   ++ mcs   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca