how do I convert a date to YYYYMMDD?

jo112358

I have two tables with two different date formats and I need to compare them. I am trying to convert the field Q_RATE_DATE; how do I change it from '27-JUN-12' to 20120627?

I tried:

TO_DATE(Q_RATE_DATE, 'DD-MON-YY', 'YYYYMMDD') 

no luck, what am I doing wrong?

mathguy

Actually it seems to me that BOTH columns are of character data type - otherwise it does not make sense to speak of "format." And in that case the correct solution is

to_char(to_date(Q_RATE_DATE, 'dd-mon-yy'), 'yyyymmdd')

(Well - actually the correct solution is to store dates in DATE data type, but it is entirely possible the OP has no control over that.)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How do I convert a Firestore date/Timestamp to a JS Date()?

How do I convert datetime to date (in Python)?

How do I convert a datetime to date?

AngularJS how to convert string "yyyyMMdd" to date

Convert yyyymmdd(int type) to date

How to convert timestamp (with dot between second and millisecond) to date(yyyyMMdd) in Hive?

How to convert date stored in YYYYMMDD to datetime format in pandas

How do I convert a string with no delimiters into a date?

How to convert a given date in format YYYYMMDD to previous day

How do I validate a YYYYMMDD string is a date in Excel VBA?

VBA - How do I convert Date into String

How to convert a date to string in format YYYYMMDD?

Is there a term for this type of date and how do I convert it?

How do I convert a date timestamp in oracle to a date?

How do I convert a factor into date format?

How to convert from day of year and year to a date YYYYMMDD?

How do i convert this date string to datetime?

How do I convert JSON string date to a custom format date?

How can I get my YYYYMMDD value to convert to DateTime?

convert date format to 'YYYYMMDD'

How do I convert date to format "ddmmyyyy"

How can I convert get date to format of yyyymmdd?

How can I convert a date coming in as YYYYMMDD into MM/DD/YYYY or MM/D/YYYY depending on its length

Convert yyyyMMdd to date with Spark

How i do convert datetime to date pandas?

How do I replace the yyyymmdd to pick the latest month end date for Table Name

SQL: How do I convert nvarchar to date

How do I convert a Date to Firebase Timestamp

How to convert YYYYMMDD string to date in databricks SQL end point?

TOP Ranking

  1. 1

    Failed to listen on localhost:8000 (reason: Cannot assign requested address)

  2. 2

    How to import an asset in swift using Bundle.main.path() in a react-native native module

  3. 3

    Loopback Error: connect ECONNREFUSED 127.0.0.1:3306 (MAMP)

  4. 4

    pump.io port in URL

  5. 5

    Spring Boot JPA PostgreSQL Web App - Internal Authentication Error

  6. 6

    BigQuery - concatenate ignoring NULL

  7. 7

    ngClass error (Can't bind ngClass since it isn't a known property of div) in Angular 11.0.3

  8. 8

    Do Idle Snowflake Connections Use Cloud Services Credits?

  9. 9

    maven-jaxb2-plugin cannot generate classes due to two declarations cause a collision in ObjectFactory class

  10. 10

    Compiler error CS0246 (type or namespace not found) on using Ninject in ASP.NET vNext

  11. 11

    Can't pre-populate phone number and message body in SMS link on iPhones when SMS app is not running in the background

  12. 12

    Generate random UUIDv4 with Elm

  13. 13

    Jquery different data trapped from direct mousedown event and simulation via $(this).trigger('mousedown');

  14. 14

    Is it possible to Redo commits removed by GitHub Desktop's Undo on a Mac?

  15. 15

    flutter: dropdown item programmatically unselect problem

  16. 16

    Change dd-mm-yyyy date format of dataframe date column to yyyy-mm-dd

  17. 17

    EXCEL: Find sum of values in one column with criteria from other column

  18. 18

    Pandas - check if dataframe has negative value in any column

  19. 19

    How to use merge windows unallocated space into Ubuntu using GParted?

  20. 20

    Make a B+ Tree concurrent thread safe

  21. 21

    ggplotly no applicable method for 'plotly_build' applied to an object of class "NULL" if statements

HotTag

Archive