• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Oracler Date function

 
Clarice Doe
Greenhorn
Posts: 21
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have 3 columns in a table say, A_DATE, A_TIME and A_DATETIME. The data type for all the columns is DATE.

Now I want to take the date part from A_DATE, time part from A_TIME, and insert those date & time values into A_DATETIME.

I could get the date & time part from the 2 columns using to_char funtion, but I don't know how to merge them and put it in to the third column. Any suggestions.

Thanks
 
Shailesh Chandra
Ranch Hand
Posts: 1082
Java Oracle Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont have database to test this but this works




Shailesh
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You just want a query or you want it in your application. If its something your application needs to do then you had better do it in your code.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic