Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Month of Date 3/17/2014 0:00

I have a datefiled in the folowing format .

3/17/2014  0:00

How can we get month ?

1 Solution

Accepted Solutions
Nicole-Smith

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'))

View solution in original post

3 Replies
Nicole-Smith

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'))

swuehl
MVP
MVP

Maybe like

=Month(Timestamp#('3/17/2014  0:00','M/DD/YYYY  h:mm'))

maxgro
MVP
MVP

=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'))