Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have date field in the following format: 6/29/2017 10:35 AM.
I want to extract the year from the field, i try the function year but it doesn't work.
Any Idea?
Thank you!
Try this
Year(Date#(FieldName, 'M/D/YYYY hh:mm TT')) as Year
maybe this:
Year(Date#(FieldName, 'MM/DD/YYYY hh:mm TT')) as Year
Great ! it's work - Thank you!
Thank you
My date is in the below format :
2019-07-28 00:00:00.0000000
and when I use your code the year shows as empty. Could you help me to solve the issue?
to extract the year you can use this verison :
Year(Date#('2019-07-28 00:00:00.0000000', 'YYYY-MM-DD hh:mm:ss.0000000')) as Year
Thank you, its works but what about if I have many dates in my Excel sheet and I want to show in the filter all years not only 2019.
you just have to change the hard date to the your date field name
like
Year(Date#([Your_Date], 'YYYY-MM-DD hh:mm:ss.0000000')) as Year
I have more than 10000 date from 2000 to 2019 so there is way to show only year in the filttrt ?