Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
s1:
load * inline [
date
4/27/2015
];
s2:
load *,
date(Date#(date,'dd/mm/yyyy'),'MM/DD/YYYY') as newdate
resident s1;
drop table s1;
hai i excute this above senario i give 4/27/2015 like this by using date and date# function i will write dd/mm/yyyy but the answer is coming 01/04/2015 but i give 27 on date but they excute 01 as date.....................................
Hi,
When you write mm in date format it is consider as minutes not Month
and just query
how could 27 is your month
try date(Date#(date,'DD/MM/YYYY'),'MM/DD/YYYY') as newdate
Regards
hi,
try this
date(Date#('4/27/2015','MM/DD/YYYY'),'DD/MM/YYYY')
You are parsing the date incorrectly. Your date is MM/DD/YYYY but you are telling the application that it is DD/MM/YYYY. There is no month 27. And the 01/04/2015 is actually 04 Jan 2015 not 01 Apr 2015.
I believe, what you want is something like this:
s2:
load *,
date(Date#(date,'mm/dd/yyyy'),'dd/mm/yyyy') as newdate
resident s1;
I am curious to know but does it make a difference if month is single digit and we should use 'M/DD/YYYY' or if it doesn't matter?
Date(Date#('4/27/2015','MM/DD/YYYY'),'DD/MM/YYYY')
Date(Date#('4/27/2015','M/DD/YYYY'),'DD/MM/YYYY') or
Date(Date#('4/27/2015','M/D/YYYY'),'DD/MM/YYYY')
Will they all give me the same result?
Best,
Sunny
If you are using the same Date format in the entire application just change the Date's Global variabl format.
Hi,
Kindly watch below attached file.
Regards,
Nagarjuna
All your statements will return the same result. It doesn't matter whilst parsing the date, QlikView is intelligent enough to read the date properly (but it affects when formatting the date).
Good to know that, I am going to still test it for my satisfaction
Thanks,
Sunny