to-date

ORA-01861: literal does not match format string

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...

Converting to date with multiple possible masks in Oracle

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...

Oracle to_date SQL formatting odd behavior

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...

Literal does not match format string for Oracle SQL to_date on a string column

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 ...

OracleCommand seems to convert literal dates

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...

Oracle to_date function. Mask needed

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 ...