Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hello can any one help me whats going wrong in my statement please
table:
LOAD * INLINE [
orderdate
02-01-2015
02-03-2015
02-05-2015
02-09-2015 //mm-dd-yyy
31-02-2015 //dd-mm-yyyy
28-02-2015
];
load date#(orderdate,'MM-DD-YYYY') as date1
Resident table;
So your date is formatted DD-MM-YYYY and MM-DD-YYYY? How would you determine if something like 02-09-2015 is always going to be MM-DD-YYYY what if for this one time it is DD-MM-YYYY. I think you need to give more information before we can guide you.
Best,
Sunny
Hi,
something like
table:
LOAD *,
Date(Alt(Date#(orderdate,'MM-DD-YYYY'),Date#(orderdate,'DD-MM-YYYY'))) as orderdate2
Inline [
orderdate
02-01-2015
02-03-2015
02-05-2015
02-09-2015
28-02-2015
27-03-2015
28-03-2015
03-29-2015
03-30-2015
03-31-2015
];
would deliver a result for both input date formats (formatted using your default DateFormat), but like Sunny already pointed out, there are ambiguous values that might lead to wrong results.
hope this helps nevertheless
regards
Marco
Hello Sunny T,what i was thinking, is it possible to change the date which is in dd-mm-yyyy to mm-dd-yyyy and display the entire orderdate field in one single formate instead of two formates..u known what i mean to say.....
it was just a general doubt which had rise in me mind,i dont known whether this is a appropriate question or not
anyway thanks for your replays for my posts man
Hello Marco Wedel ,thanks for your reply ,now i can change the entire orderfield in to single formate instead of having two formats thanks man