Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How to convert the Date column to DATE format.
I tried the below code but format function Date# is not working for second record.
Please advise.
Data:
load * ,DATE(DATE#(Date#(Date,'YYYY/DD/MM'),'YYYY/MM/DD')) AS NEW_DATE;
load * inline [
Sno,Date
1,2010/31/01
2,2011/02/28
];
You can get the same done using if( IsNum(.. which is actually an expanded version of alt(). Would that be of any help for you?
DATE(If( Isnum(Date#(Date,'YYYY/DD/MM')),Date#(Date,'YYYY/DD/MM'),DATE#(Date,'YYYY/MM/DD'))) AS NEW_DATE;
Brother ,
Isnum() will retun either -1 or 0 whether the above will work?????
I guess it would not take much of your time - to check if that works or not. Just try yourself like:
Data:
load * ,DATE(If( Isnum(Date#(Date,'YYYY/DD/MM')),Date#(Date,'YYYY/DD/MM'),DATE#(Date,'YYYY/MM/DD'))) AS NEW_DATE;
load * inline [
Sno,Date
1,2010/31/01
2,2011/02/28
];
Did it work? Please let know.
Brother its working if dnt mine can u pls say hw it is possible
You are great. Thanks for the information.
YOU ONLY TWO FORMATS MENTIONED IF THERE IS DIFFERENT FORMATS
HOW DID YOU WRITE THE EXPRESSIONS