Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
robert_mika
Master III
Master III

Covert to a Date Format

What's is the best way to covert string text

Oct/21/2014

at the Load level

to read

21-Oct-2014

1 Solution

Accepted Solutions
its_anandrjs

Try this way with Date# and Date functions.

Ex:-

Table:

LOAD Date(Date#(DateField,'MMM/DD/YYYY'),'DD-MMM-YYYY') as NewDate,DateField;

LOAD * Inline

[

DateField

Oct/21/2014

];

View solution in original post

4 Replies
alexandros17
Partner - Champion III
Partner - Champion III

No best but different ways depending on your need, a quick way is using Date(date, format) ....

its_anandrjs

Try this way with Date# and Date functions.

Ex:-

Table:

LOAD Date(Date#(DateField,'MMM/DD/YYYY'),'DD-MMM-YYYY') as NewDate,DateField;

LOAD * Inline

[

DateField

Oct/21/2014

];

er_mohit
Master II
Master II

Hi

Use Data and Date # function l

try this in text object

=Date(Date#('Oct/21/2014','MMM/DD/YYYY'),'DD-MMM-YYYY')

and same can do in load level just replace date string with your Datefield  like

Date(Date#(DateField,'MMM/DD/YYYY'),'DD-MMM-YYYY') as Date

maxgro
MVP
MVP

you need 2 function

date#      interpretation function from string to number

and then

date        formatting function from number to string

in the attachment more detail

you already get the answer in previous post (replace 'Oct/21/2014' with your field)

load

     ...

     date(date#('Oct/21/2014', 'MMM/DD/YYYY'), 'DD-MMM-YYYY') as NewDate

     .....

from

     ....