Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All,
I had to convert "DATE_FACTURATION" which is in the format of DD/MM/YYYY into Monthname and Year (example (14/03/2016 into Mar-2016) and I managed to do it using the below:
month(Date(alt(Date#(DATE_FACTURATION, 'DD/MM/YYYY')), 'DD/MM/YYYY')) & '-' & year(Date(alt(Date#(DATE_FACTURATION, 'DD/MM/YYYY')), 'DD/MM/YYYY')) as Mois_enquete_calcul,
However now I need to use the date "DATE_FACTURATION" to calculate the date minus 6 months and to show in the format of Monthname and Year.
Example:
DATE_FACTURATION Mois_enquete_calcul
14/03/2016 Aug-2015
Any idea?
Kind Regards,
Hasvine
Date(MonthStart(Date#(DATE_FACTURATION, 'DD/MM/YYYY'),-6),'MMM-YYYY')
But perhaps this will work too: Date(MonthStart(DATE_FACTURATION),-6),'MMM-YYYY')
Date(MonthStart(Date#(DATE_FACTURATION, 'DD/MM/YYYY'),-6),'MMM-YYYY')
But perhaps this will work too: Date(MonthStart(DATE_FACTURATION),-6),'MMM-YYYY')
Hi
Try like this
In script, Convert your date field in date format
For ex:
Load *, Date(Date#(DATE_FACTURATION, 'DD/MM/YYYY'), 'DD/MM/YYYY') AS FACTURATIONDATE
your tablename;
Then in front end,
Date(MonthStart(FACTURATIONDATE,-6),'MMM-YYYY')
hope it helps
You can also try MonthName() function:
LOAD DATE_FACTURATION
MonthName(AddMonths(DATE_FACTURATION, -6)) as Mois_enquete_calcul
FROM ...
It works great.
Thanks,
Hasvine