Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi - I have the following variable:
vForecastDateStart
=date(today(),'MM/DD/YYYY')
I would like to convert it to a numeric value such as YYYYMMDD
I tried this :
vForecastDateStartNumeric:
num(left(Date($(vForecastDateStart),'MM/DD/YYYY'),4)&left(right(Date($(vForecastDateStart),'MM/DD/YYY'),4),2)&right(Date($(vForecastDateStart),'MM/DD/YYY'),2))
No luck - any thoughts ? thanks - Jerry
Hi Jerry,
I think Date# will do it.
Date(Date#($(vForecastDateStart),'YYYY-MM-DD'),'YYYY/MM/DD')
Hi, with simple quotes for variable value it should work, also you need to change the date format:
num(left(Date('$(vForecastDateStart)','YYYYMMDD'),4)&left(right(Date('$(vForecastDateStart)','YYYYMMDD'),4),2)&right(Date('$(vForecastDateStart)','YYYYMMDD'),2))
Or just:
=Num#(Date('$(vForecastDateStart)','YYYYMMDD'),'0')
date(Today(),'YYYYMMDD')
or
num#(date(today(),'YYYYMMDD'))
Regards,
Prashant Sangle
Do you want to present it as Date with format YYYYMMDD or do you want to store it as the number YYYMMDD?
If date with format then your got the answer from earlier repliers.
If number then you would need to wrap text(), num(text()) or evaluate (text()) around it.
Like this
Num( Text( Date( date#('$(v Forecast DateStart)', 'MM/DD/YYYY'), 'YYYYMMDD')))
Hi Jerry,
I think Date# will do it.
Date(Date#($(vForecastDateStart),'YYYY-MM-DD'),'YYYY/MM/DD')
Hi,
You can try this:
=Num#(Date('$(vForecastDateStart)','YYYYMMDD'),'0')
Thanks,
Usama
perfect ! Thank you !