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
-1
votes
1 answer

How to use the "to_date" function in Oracle with a variable as parameter?

I have a stored procedure that contains the following: V_DATACONVERTIDA varchar2(100) := TO_DATE('27/10/1994 23:59:59', 'DD/MM/YYYY HH24:MI:SS.SSSSS'); It works fine, but the problem is I gotta make that date a variable. So I…
Rodrigo
  • 11
  • 2
  • 8
-2
votes
1 answer

How do I remove the time portion from a epoch conversion in SQL

I am trying to get ride of the time portion of a conversion from epoch time to human readable form. Here is what the data output looks like currently: Ticket Number Created Completed 14111487 2/1/2023 1:36 AM 2/15/2023 6:00…
-2
votes
2 answers

to_date returns wrong year

I need help regarding date output. I am new to oracle, mostly of my time I am using msSQL. I have a date and time stored as varchar and I need output so that I can import it to sql db. select to_date('210408092508', 'yy/mm/dd HH24:MI:SS') from…
sosNiLa
  • 289
  • 6
  • 18
-2
votes
1 answer

java.sql.SQLException: ORA-01843: not a valid month error

I am getting date in html 5 input type = "date" format..in mm/dd/yyyy format. Then I am getting it String fDate = request.getParameter("fromDate"); room.setFromDate(fDate); Then while trying to run query insert into…
shashin
  • 1
  • 1
  • 1
-2
votes
1 answer

What does this to_date() function of PLSQL do?

TO_CHAR(( TO_DATE(calendar_key,'YYYYMMDD' )+ 1),'IW') week Can somebody tell me what's happening in this query? I know what the to_date operation does, I am confused about the '+1' over there, does it add 1 year to the date?? And what about the…
Niranjan Sonachalam
  • 1,545
  • 1
  • 20
  • 29
-3
votes
3 answers

to_date() takes 1 positional argument but 2 were given

| date| +----------+ | 2/3/1994| | 3/4/1994| | 4/5/1994| | 5/3/1994| | 6/9/1994| | 7/8/1994| | 8/9/1994| | 9/10/1994| |10/10/1994| | 11/4/1994| | 12/3/1994| | 2/4/1996| | 4/9/1996| | 5/7/96| | 6/8/1996| | 7/10/1996| | 9/11/1996| |…
-3
votes
1 answer

Oracle : date not valid for month specified

i am trying to insert a record in oracle using toad and getting the error. As seen below i am using the TO_DATE FUNCTION date not valid for month specified. I am using TO_DATE function. INSERT ALL INTO MGR.TRACK_RECORD…
Tom
  • 8,175
  • 41
  • 136
  • 267
-5
votes
2 answers

SQL Server equivalent of dense_Rank() and TO_DATE() of Postgres

I have the below query coming from the Postgres database. I want to convert the below query from Postgres to an Azure SQL Server version. I know that TO_DATE can be written as convert(DATETIME,...) but I want to protect the date format too. Even…
yed2393
  • 262
  • 1
  • 12
1 2 3
19
20