Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

WHAT IS THE REASON

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.....................................

9 Replies
PrashantSangle

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

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
arulsettu
Master III
Master III

hi,

try this

date(Date#('4/27/2015','MM/DD/YYYY'),'DD/MM/YYYY')

quwok
Creator III
Creator III

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;

sunny_talwar

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

hariprasadqv
Creator III
Creator III

If you are using the same Date format in the entire application just change the Date's Global variabl format.

nagarjuna_kotha
Partner - Specialist II
Partner - Specialist II

Hi,

Kindly watch below attached file.

Regards,

Nagarjuna

quwok
Creator III
Creator III

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).

sunny_talwar

Good to know that, I am going to still test it for my satisfaction

Thanks,

Sunny

maxgro
MVP
MVP

your date is already in the format you want

MM/DD/YYYY