In a message dated 00-11-30 11:41:09 EST, you write:
Convert it to character using the char function. Then use the todate
function to convert it to a date. This will do it in BO. I’m sure there
is
a way to do it in Oracle, but I’ll leave that for Dave.
I am currently trying to change a text date object, 20000103 (########), to MM/DD/YY.
Okay Steve, I’ll take it from here…
You have a character string with the format YYYYMMDD. You may want to convert it to a “real” date. For that, all you have to do is use the to_date() function, as follows:
to_date(my_string,‘YYYYMMDD’)
The syntax of to_date() in Oracle is to_date( date_value, string_format ). You enter the format that tells the to_date() function how the date looks, and it converts to a true date value. You can format it any way you want to on the report side, including what you are asking for. You can sort by date, query by date, etc.
Now, if you want to return the value back to a character string in the format you supplied, that requires one more step:
to_char(to_date(my_string,‘YYYYMMDD’), ‘MM/DD/YY’)
The to_date converts the string to a date, the to_char converts back to a character string. The alternative would be to use substring and concatenation to do the same thing, but this is much easier.
Regards,
Dave Rathbun
Integra Solutions
www.islink.com
Listserv Archives (BOB member since 2002-06-25)