Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Oracle

 
Graham Thorpe
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all

I facing one oracle query problem ..

In one table i have one column named "today_date" as type varchar;
And another table i have another column named"cf_Auth_dt" as type date.
So i need to substract these dates .
Can any body give idea !!!
Thanks and Regards
Reddy
 
Wayne L Johnson
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried to do a simple subtract on a table with two dates (in Oracle) and it seems to return a real value representing the number of days/hours [eg., 12.75 = 12.75 days, or 12 days and 18 hours]. So you just have to convert the varchar date into a date field. Something like this:

You need to specify the correct format for the varchar date [however it's stored in the database], and the rest should be fairly obvious. This is how it's done in SQL.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic