Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
cancel
Showing results for 
Search instead for 
Did you mean: 
gz
Creator
Creator

Date format from 45713 to DD.MM.YYYY

Hi, I have variable vCurrMonthYear = num(MonthName(addmonths(today(),0))) how Can I change it to DD.MM.YYYY ?

Labels (2)
3 Solutions

Accepted Solutions
sandeep-singh
Creator II
Creator II

Instead of the NUM, use date function and format you want to use

Date(MonthName(addmonths(today(),0)),'DD.MM.YYYY')

View solution in original post

MarcoWedel

As AddMonths(date,0) leaves the date untouched (i.e. adding 0 months) your expression could be shortened to
MonthName(Today()).

Formatting as Date could be done like Date(MonthName(Today()),'DD.MM.YYYY').

Depending on your DateFormat variable you might as well use MonthStart(Today()) 

In case you actually want to add a number of months other than 0, you could do so using the second parameter of the MonthStart() or MonthName()  function, e.g. MonthStart(Today(),2).

 

hope this helps

Marco

View solution in original post

Rams-
Creator
Creator

Hi,

Instead of using :  vCurrMonthYear = num(MonthName(addmonths(today(),0)))

You can you: vCurrMonthYear = Date(MonthName(Today()),'DD.MM.YYYY')

 

Hope this helps,

help user find answers ! don't forget to mark  a solution that work for you and click the like button!

View solution in original post

3 Replies
sandeep-singh
Creator II
Creator II

Instead of the NUM, use date function and format you want to use

Date(MonthName(addmonths(today(),0)),'DD.MM.YYYY')

MarcoWedel

As AddMonths(date,0) leaves the date untouched (i.e. adding 0 months) your expression could be shortened to
MonthName(Today()).

Formatting as Date could be done like Date(MonthName(Today()),'DD.MM.YYYY').

Depending on your DateFormat variable you might as well use MonthStart(Today()) 

In case you actually want to add a number of months other than 0, you could do so using the second parameter of the MonthStart() or MonthName()  function, e.g. MonthStart(Today(),2).

 

hope this helps

Marco

Rams-
Creator
Creator

Hi,

Instead of using :  vCurrMonthYear = num(MonthName(addmonths(today(),0)))

You can you: vCurrMonthYear = Date(MonthName(Today()),'DD.MM.YYYY')

 

Hope this helps,

help user find answers ! don't forget to mark  a solution that work for you and click the like button!