I have a date/time column in SharePoint 2013 list. I'd like to use Nintex to determine the month of that date/time column. I will have to filter that list later based on the recent month items. So I would need to be able to pull items that are dated for April. Next month, I'd have to pull items for May, etc.
I'd add a new column on the SharePoint list with a formula to get the month
Yeah, I figured I'd add a column but I didn't know what the formula would be to get the month.
burkslm Assuming you've got a SharePoint list date column named 'TestDate', these formulas used in calculated columns will give you what you need:
- =TEXT(TTestDate],"mm")
- Returns 01 if date is 12-Jan-2015
- =TEXT(TTestDate],"mmmm")
- Returns January if date is 12-Jan-2015
- =TEXT(TTestDate],"mmm")
- Returns Jan if date is 12-Jan-2015
I have a date column that is in the format of 4/13/2016. Will your solution still work?
And I need it to be in the datatype of a number not text. Because I will need to compare using <>=
Yes this format won't be a problem – it's the format I tested against:
If you're need the month number (int), just use the first of the three formulas I posted : =TEXT([TestDate],"mm"). This will return '04' for 4/14/2016.
I want to return 4 not April.
I hate to be a pain, but I don't want to have leading 0s. I'm going to have to do comparisons. I was getting an error when I did what you posted.
Regarding the datatype, you can configure this on the creation of a calculated column. Do so by specifying 'number' when asked which data type you'd like returned from your formula (last property).
Ok - it was my fault. Yes, I specified number but I made a mistake and forgot the first parentheses. And instead of "mm", I did "m". Thanks so much!
How would you return "April, 2016" (i.e. not just the month as full text, but also the year)?
Create a new question
For your needs Drew Abas – You'd need the following formula (assuming you've got a date-time column named TestDate):
- =TEXT(TestDate," MMMM, yyyy")
Also, don't forget to set your data-type to "Date and Time Format > Date Only."
Works like a charm! Thanks!
no problem – glad that worked for you!
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.