I'm pretty sure this is something really silly.
Instead of spending another 10 minutes with this ( or better said, while I spend another 10 minutes with this ) I'll ask it here in parallel.
What's wrong with the following statement:
select to_date( '30/10/2009 18:27:35', 'DD/MM/YYY HH24:MI:SS') from dual
The error message is:
Err...
It so happens that I have to get a date from a varchar2 column in oracle, but it is inconsistent in formatting. Some fields might have '2009.12.31', others '2009/12/32 00:00:00'. Is there any standard construct I could use, so that I don't have to go through
begin
to_date(date, mask1)
exception
begin
to_date(date,mask2)
except...
I've trawled the SO website thinking this is pretty obvious but alas I have not found one yet.
Basically the setup is as follows:
I have a string in a table like so:
06/22/2010 00:00:00
I do a select on it:
SELECT To_Date(item, 'MM/DD/YYYY HH24:MI:SS') from that_table
so that effectively I am doing
SELECT To_Date('06/22/2010 0...
Dear SQL Gurus from Stack Overflow:
Environment: Oracle
I'm trying to understand why I can't do a to_date selection on a table column that contains strings. Note tableZ with a column of name Value in the example below contains a bunch of strings, some of which are the correct format, for example 6/20/2010 00:00:00.
tableZ
| Value ...
Hi,
I built a small query tool for Oracle using OracleCommand and OracleDataAdapter. Users just input a full query (no parameters), execute and the results are shown in a datagridview. So far so good, although I tried an invalid query, e.g.:
SELECT * FROM mytable WHERE dateColumn = '1-JAN-10'
This query is not valid SQL for Oracle. Y...
I have string of date from xml file of such kind: '2010-09-09T22:33:44.OZ'
I need to extract only date and time. I want to ignore symbol T and .OZ (time zone). Which mask I should use? Thanks in advance
...