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

insert statment make error

I am using oracle 12c with the username system. My problem is when I execute this insert statement that I took from oracle live sql site: insert into emp values(7788, 'SCOTT', 'ANALYST', 7566,to_date('13-JUL-87','dd-mm-rr') - 85,3000, null, 20);…
Zain Elabidine
  • 349
  • 5
  • 16
0
votes
2 answers

Oracle SQL -- TO_CHAR and TO_DATE Statement

I'm working in an Oracle DB and I'm trying to convert from 12 hours to 24 hours. I have currently updated the HH to HH24 and I'm still seeing the full 24hour time and in fact it's only pulling the first 12 hours of the day. The below is my working…
LivinLife
  • 109
  • 1
  • 13
0
votes
2 answers

Why is to_date needed to pull data from Oracle into Crystal Reports

If I run the following select in PL/SQL from my Oracle DB I return expected results: select * from risk t where t.accounting_to_date='01-JAN-3000' When I run the same select statement in Crystal Reports 2016 using a command and an Oracle…
Leigh
  • 1
  • 1
0
votes
3 answers

Oracle SQL: Converting a flexible integer into time

i can convert a 4-digit-number (2300 e.g.) into (23:00) with the following Statement: select to_char ( to_date ( 2300, 'HH24MI'), 'HH:MI') integer_time from dual; Result: INTEGER_TIME -------- 11:00 But how can I help myself if the values in…
MavidDeyers
  • 180
  • 1
  • 14
0
votes
2 answers

Oracle SQL date getting first day of last quarter and last day of last quarter

I've been asked to provide an Oracle PL/SQL solution if a file is loaded into the system for example between the dates of 1st Jan 2017 - 31st March 2017 I should created two dates from the last quarter a loaded from date of 1st Oct 2016 and loaded…
Shaun Kinnair
  • 495
  • 2
  • 10
  • 27
0
votes
0 answers

Pig DateTime Invalid Format error

I am trying to load an input file using Pig The input data is id, event_date 894, 10-Sep-2014 02:38:29 The event_date is loaded as char array and then it is converted using Pig ToDate function as ToDate(event_date,'dd-MMM-yyyy HH:mm:ss') When…
DPK
  • 101
  • 1
  • 1
  • 7
0
votes
2 answers

Why do I get an "Invalid month" error when storing a date in an Oracle database using C#?

I am trying to update the Oracle table using C#. I have written one function public int UpdateInfo(String emplid, bool i4, char?status,String bdate) { int result = -1; try { using (OracleConnection conn = new…
user2897967
  • 337
  • 2
  • 8
  • 24
0
votes
0 answers

Oracle SELECT Query With Multiple Date Formats

I am attempting to select a date column that includes multiple date formats, including yyyymmdd and yyyy. When running the query below, the following error occurs: ORA-01840: input value not long enough for date format ALTER SESSION SET…
ID10T
  • 25
  • 2
  • 11
0
votes
1 answer

Oracle giving ORA-01821 on a format that appears to be valid

Calling SELECT TO_DATE('Mon Sep 22 18:02:41 CDT 2014', 'DY MON DD HH24:MI:SS TZD YYYY') FROM Dual; I get ORA-01821: date format not recognized 01821. 00000 - "date format not recognized" I put together the format string from these Oracle…
Greg Dougherty
  • 3,281
  • 8
  • 35
  • 58
0
votes
4 answers

how do to_date function in postgresql works?

select to_date('20170202','YYYYMMDD'); returns: 2017-02-02 but when i do: select to_date('20172202','YYYYMMDD'); the output is : 2018-10-04 when the Month is wrong why don't it returns an error as in Oracle?
Kamfasage
  • 181
  • 1
  • 7
  • 14
0
votes
1 answer

Can anyone tell me why I'm getting null when using to_date hive (version 1.2) function?

all I created an external table in my Hive 1.2 database. Check 5 first rows: hive> select dt_locacao from locacao_aux_externa limit 5; OK '2010-11-21' '2009-03-20' '2010-02-16' '2012-12-20' '2017-12-19' Time taken: 0.253 seconds, Fetched: 5…
0
votes
5 answers

Oracle to_date returns an error 01843

When trying to do select statement it returns an error. Formatting seems right. Please point where am I mistaken. SELECT to_date (CALL_DATE,'DD-MON-YYYY HH24:MI') AS DATET FROM XXXXXX where CALL_DATE is a VARCHAR2 type column, where date is stored…
0
votes
1 answer

Oracle sql in NetSuite

I am trying to convert Jan 2017 to a date of 1/1/2017 and I am hitting so many roadblocks. I can get it to be a text value of '1/1/2017' with a {formula} but when I try to do to_date({formula},'MM/DD/YYYY') it just gives an error. Any thoughts?
0
votes
2 answers

Oracle to_date error

I have a source application which is using varchar type to store dates. All the dates are supposed to be in yyyymmdd form. So now, when I run this query select (case when PLE_DATE = '00000000' then null else to_date(PLE_DATE,'yyyymmdd') end)…
user1751356
  • 565
  • 4
  • 14
  • 33
0
votes
1 answer

Converting a LocalDateTime of the year 2CE out by one day when converting to java.util.Date

I have a date in represented by the string "0002-01-04T00:49:40.000" i.e., a date in the year 2CE. I need to convert it to an instance ofjava.util.Date by combining it with the timezone id "Etc/UTC". The following code shows how I do it: public…