Questions tagged [to-date]

to_date is sql function that converts string to date

to_date is an SQL function that converts a string to a date.

Reference

293 questions
0
votes
1 answer

PL/SQL: Sysdate-to_date

I'm trying to understand some notes from a Uni assignment. The lecturer is calling a function and sending the function the parameter "sysdate-to_date['1-Jan-2014']". What is this parameter actually doing and what type of variable does it send?
Brendon Rother
  • 119
  • 4
  • 17
0
votes
0 answers

C# Insert DATE into ORACLE -- A non-numeric character Error?

I am trying to insert a date from C# into an Oracle DATE field. Here is the format that I have currently.. to_date('2008/06/09', 'YYYY/MM/DD') I have verified that my date is a valid date, and that it is in the format expected. The above throws…
Bruce Pullum
  • 249
  • 1
  • 2
  • 13
0
votes
2 answers

to_date inside callablestatement

I'm trying to use a to_date function inside a callableStatement. My statement ends up being RGPKG.PKG_RG_LEAD.ADD_LEAD('TO_DATE('05-Aug-2014 11:53:34 AM', 'DD-MON-RR HH.MI.SSXFF AM')', ) I'm using…
Mike McK
  • 3
  • 2
0
votes
1 answer

Converting Oracle's to_date to Informix' to_date

I need to convert a WHERE-statement with a TO_DATE-function from Oracle to Informix 10. Unfortunately I have no direct access to the Informix instance and can execute SQL only over a Job Management GUI, which makes testing by try-and-error quite…
royskatt
  • 1,190
  • 2
  • 15
  • 35
0
votes
3 answers

How to make this sql code in Java

Does anyone know how to implement this SQL code in Java code? to_char(to_date(time,'sssss'),'hh24:mi') Time format is like 36000 in database and then after this sql command it is: 10:00 I want to make this function work in Java not SQL.
Vuk Vasić
  • 1,398
  • 10
  • 27
0
votes
0 answers

ORA-01843 not a valid month using OCI8 php

I have a oci8 module installed with PHP and when using a to_date conversion in my query I get an error. When I use the exact same query in my sql developer it works just fine. php: include("db_connection.php"); $query = "select count(distinct…
0
votes
2 answers

Order by time stored as Varchar

I have a column(s_time) as varchar. I store 12 hours time(7:00 AM). I want to order by this column(s_time). I tried with this oracle query select * from tabl_time order by to_date('s_time','hh12:mi') asc But this did not work. Can anyone …
Shanna
  • 753
  • 4
  • 14
  • 34
0
votes
0 answers

set up proper date format

in csv file I have column, where are date's with diffrent format as below: 02/03/2014 00:10 1/02/2014 7:25:00 7/03/2013 8:30:00 PM How to set up proper date into CTL file in SQL-LOADER? column1 "to_date(:column1, 'DD/MM/YYYY HH24:MI:SS')"
0
votes
0 answers

Is there an equivalent TO_CHAR or TO_DATE SQL function in HSQLDB, ver. 1.8.0?

I have an HSQLDB, ver. 1.8.0, database that I would like to run some SQL date functions on (such as a date range select). Is there an equivalent HSQL function to do this with a column that is defined as a BIGINT?
atom88
  • 1,449
  • 3
  • 22
  • 32
0
votes
2 answers

TO_DATE function Oracle SQL

I am trying to select data from a certain date from range, but not within a certain set of parameters. Currently: SELECT external_reporting_id AS asin, last_updated AS "Received" FROM transfer_delivery_items WHERE last_updated >=…
Nomad
  • 250
  • 3
  • 11
  • 27
0
votes
3 answers

Convert dd-mon-yy string to date in DB2

in DB2 I've got date values stored as varchar in the form 'DD-Mon-YY' (e.g. 25-Jun-13). I'd like to convert these into DB2 compatible date formats using the TO_DATE function but every date conversion format I've tried gives me an error. e.g. I've…
user3130997
  • 11
  • 1
  • 1
  • 1
0
votes
3 answers

Compare C# Date with SQL Date within a Query

I'm trying to compare a C# DateTime with a SQL-server DateTime in a Stored Procedure but it keeps giving me convert-errors. At first someone else made the Oracle function for this: 'Select blabla from bla WHERE (TO_DATE (''' + cast(@dateEnd as…
Akorna
  • 217
  • 2
  • 16
0
votes
2 answers

how to handle date format using to_date function in oracle?

I have a select query that consist an expression of TO_DATE(expiry_date, 'YYMM'). It works if expiry_date is in YYMM format. I want to set data as 0001 if expiry_date is in incorrect formats that are like YYM, YY,MM,YMM etc. Is this possible?
Mehmet Ince
  • 4,059
  • 12
  • 45
  • 65
0
votes
2 answers

PL/SQL Convert string to date when some values are not in a date format?

I have a string field where 99% of the entries are in a format that can be converted to a date, i.e. To_DATE(' 20100501', 'yyyymmdd') would work great. However, about 1% of the entries are in as something like '00000000' or '00000500'. So when I try…
Dan
  • 75
  • 1
  • 2
  • 6
0
votes
0 answers

ORACLE Date comparison issue - confused

I have the table that has a record with the value 23-JUL-13 for contact_date (Date type). I tried to run this query: select * from mytable where contact_date >= to_date('25-JUL-2012', 'dd-MON-yyyy') I was expecting the above record to be…
Kevin Rave
  • 13,876
  • 35
  • 109
  • 173