Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a date field , and the dates are displayed in the yyyy-mm-dd and yyyymmdd format I need to convert it into one format ie mm-dd-yyy in the script editor
Thx
B
try this
alt(date#(MyDateField, 'YYYY-MM-DD'), date#(MyDateField, 'DD-MM-YYYY'), date#(MyDateField, 'DD/MM/YYYY'), 'No Date Found') AS
MyDateField
Thx
MS
Did you try > date(datefield, 'MM-DD-YYYY')
Thanks nick for the reply
I know the following can be used
date(date#(MyDateField,'yyyymmdd'),'yyyy-mm-dd')
My questions is there a better way to do this when the filed contains dates in different formats
try this
alt(date#(MyDateField, 'YYYY-MM-DD'), date#(MyDateField, 'DD-MM-YYYY'), date#(MyDateField, 'DD/MM/YYYY'), 'No Date Found') AS
MyDateField
Thx
MS
Hi,
Try with Alt() and Date#()
Date(Alt(Date#(DateFieldName, 'yyyy-mm-dd'), Date#(DateFieldName, 'yyyymmdd')), 'mm-dd-yyy')
Regards,
Jagan.
Hi Balraj,
If you are very sure that there are two types of dates in your data and they are in the format you mentioned, then this solution will work for you.
Let us know if this helps you