Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
tmumaw
Specialist II
Specialist II

Date Formating

Hi all,

I'm trying to format a date and having issues.  I need it in a MM/DD/YY format and it keeps putting it in a MM/DD/YYYY format.  My input is MM/DD/YY.  Here's my statement:

If([Years Serv] = 0,
Date(Date#(AddMonths([Hire Date],1,'MM/DD/YYYY'),'MM/DD/YY'))) as Days_30,

Labels (1)
  • Date

1 Solution

Accepted Solutions
sunny_talwar

How about this

Date(If([Years Serv] = 0, AddMonths(Date#([Hire Date], 'MM/DD/YYYY'), 1)),'MM/DD/YY') as Days_30

or just this

Date(If([Years Serv] = 0, AddMonths([Hire Date], 1)), 'MM/DD/YY') as Days_30

 

View solution in original post

4 Replies
StarinieriG
Partner - Specialist
Partner - Specialist

Hi,

try this expression

If([Years Serv] = 0,

Date(AddMonths(Date#([Hire Date],'MM/DD/YYYY),1),'MM/DD/YY')) as Days_30,

tmumaw
Specialist II
Specialist II
Author

Any idea on bracket alignment....

sunny_talwar

How about this

Date(If([Years Serv] = 0, AddMonths(Date#([Hire Date], 'MM/DD/YYYY'), 1)),'MM/DD/YY') as Days_30

or just this

Date(If([Years Serv] = 0, AddMonths([Hire Date], 1)), 'MM/DD/YY') as Days_30

 

tmumaw
Specialist II
Specialist II
Author

Thanks Sunny the first one worked great.