I have a date field on my asp page that is coming from an Oracle database table.
Field shows: 20070515132054, how can I format it on the asp page to show 05/15/2007.
Hi,
Date types in Oracle are stored as a specially formatted number, as you have discovered..Assuming the driver you are using to connect to Oracle can handle it, use the To_Char function in your query string to format the Date as needed...
Note..It is now a string value so it would need to be reconverted to a recognized Date ( in VB or C#, whatever) if you want to use date math or other actual DATE related actions later in your code..
To Paraphrase:"The Help you get is proportional to the Help you give.."
It's been awhile since my HOracle days, but another suggestion.
To_Date(to_char(DateFieldinOracle,'MM/DD/YYYY')) or it's
To_Date(to_char(DateFieldinOracle,'MM/DD/YYYY'),'MM/DD/YYYY')
Not sure of the syntax.
But what you are doing is converting it to a char so you can format it then you are converting it back to a date to be passed to you asp page.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.