Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a datefiled in the folowing format .
3/17/2014 0:00
How can we get month ?
I've seen this date format before, and I'm guessing if there is only one digit in the hour field, there are two spaces between the date and hour, and if there are two digits in the hour field, there is only one space. If I'm correct about this, using a replace to handle the space, and then the date and month functions to handle the rest should work:
month(date#(replace(Field,' ',' '),'M/D/YYYY h:mm'))
If I'm wrong about the spaces, and there are always two spaces between the date and the hour, the replace isn't needed:
month(date#(Field,'M/D/YYYY h:mm'))
I've seen this date format before, and I'm guessing if there is only one digit in the hour field, there are two spaces between the date and hour, and if there are two digits in the hour field, there is only one space. If I'm correct about this, using a replace to handle the space, and then the date and month functions to handle the rest should work:
month(date#(replace(Field,' ',' '),'M/D/YYYY h:mm'))
If I'm wrong about the spaces, and there are always two spaces between the date and the hour, the replace isn't needed:
month(date#(Field,'M/D/YYYY h:mm'))
Maybe like
=Month(Timestamp#('3/17/2014 0:00','M/DD/YYYY h:mm'))
=num(Month(date#('3/17/2014 0:00', 'MM/DD/YYYY h:mm')))
or
=Month(date#('3/17/2014 0:00', 'MM/DD/YYYY h:mm'))