dbTalk Databases Forums  

Convert timestamp to date

comp.databases.oracle comp.databases.oracle


Discuss Convert timestamp to date in the comp.databases.oracle forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Bob
 
Posts: n/a

Default Convert timestamp to date - 03-29-2005 , 12:41 PM






Trying to convert timestamp data to date data (without the time in
hours/mins/secs), does only seem to work with TO_DATE(mydate; 'yyyymmdd').

But I do not want a string, but a real date like 29-03-2005.

How do I get it like that?

Thanks,
Bob

Reply With Quote
  #2  
Old   
Walt
 
Posts: n/a

Default Re: Convert timestamp to date - 03-29-2005 , 06:17 PM






Bob wrote:

Quote:
Trying to convert timestamp data to date data (without the time in
hours/mins/secs), does only seem to work with TO_DATE(mydate; 'yyyymmdd').

But I do not want a string, but a real date like 29-03-2005.

How do I get it like that?
1) try the trunc function, i.e. "select trunc(sysdate) from dual;"

2) try re-converting your string back to a date, i.e.
"select to_date(to_char(mydate,fmt1),fmt2) from dual;"
using appropriate format strings for fmt1 and fmt2.

3) Or maybe I don't really understand what you're trying to do. What do
you mean by "timestamp data" as opposed to "date data"?



--
//-Walt
//
//



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.