0

I have a hadoop table with date column having values like below

Date
03/22/2015 12:07:41.000000
23-MAR-15 03.25.17.000000000 PM

can you help me how can I make the values as identical while loading into my staging table.

I want output like

Date
03/22/2015
03/23/2015

1 Answers1

0

You can use CONVERT function.

To get MM/DD/YYYY format SELECT convert(varchar(10), YourColumn, 101)

And also you can use other value for the third parameter to get another format. See here for more examples

I hope it works in Hadoop.

Saeid Amini
  • 1,313
  • 5
  • 16
  • 26
  • yup it works but the asci code shows different result, 23-MAR-15 where i need 03/23/2015.. i tried – user11894930 Aug 07 '19 at 10:54
  • i am trying to write the query in impala as like below SELECT Strleft(profl.createdate,10) from infa_mdm_c_bo_prod_profl profl limit 100 and below is my result.. 01-FEB-08 03-APR-11 02/21/2019 03/20/2015 i want to get output as 01/02/2008 04/03/2011 02/21/2019 03/20/2015 – user11894930 Aug 07 '19 at 12:19