-
Converting Charater String into Date range
Hello,
We have a table with no Date datatype. However, there is a char (30) data type column where date is stored as string in YYYY/MM/DD format. I would like to select the data from this table based on date criteria. Is there a way to convert character string of yyyy/mm/dd format into desired date range (for instance, how to select all rows that are older than 30 days OR the rows between Jan 1st 2003 to July1st 2003)
Thanks
-
-
-
Originally posted by davey23uk
to_date() ?
arrgh. fastest fingers in the west...
Jeff Hunter
-
1-0 to the brits
-
Since it's in YYYY/MM/DD format,you could say ...
Code:
...
Where
my_char_date Between
Cast(To_Char(begin_date,'YYYY/MM/DD') As Char(30)) And
Cast(To_Char(end_date,'YYYY/MM/DD') As Char(30))
...
Be able to use indexes that way, and avoid a lot of overhead.
Do I get any points?
-
-
-
No points for a solution that won't kill performance, like To_Date() would?
-
point docked for being smart in class
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|