Sharepoint 2013 List-Column Validation for a Dates

Hi,

I am working on a project in Sharepoint 2013 and within the list users will be creating/using there is an "Effective Date" Column. I only want to allow users to select certain dates. Is there an easier way to do this than column validation? or what's the best formula for column validation in this instance? 

I currently have the formula for the validation and it currently doesn't work: =OR([Effective Date]="9/21/2015",[Effective Date]="10/5/2015",[Effective Date]="10/19/2015",[Effective Date]="11/2/2015",[Effective Date]="11/16/0215",[Effective Date]="11/30/2015",[Effective Date]="12/14/2015",[Effective Date]="12/28/2015")

Thanks!

September 11th, 2015 2:50pm

Assuming your Effective Date field is a Date type, then you need to compare dates to dates and not dates to strings.

=OR([Effective Date]=DATEVALUE("9/21/2015"),[Effective Date]=DATEVALUE("10/5/2015"), ...

Use Excel as an easy way to create and test validation formulas. Most, but not all, valid SharePoint calculated columns and validation expressions are valid Excel expressions. For example:

  • In a new Excel file name a cell "EffectiveDate" (sorry, no spaces in Excel cell names)
  • In any other cell create the formula using the cell names in place of the column names and normal Excel functions.
=OR(EffectiveDate=DATEVALUE("9/21/2015"),EffectiveDate=DATEVALUE("10/5/2015"), ...
  • Enter test dates in the named cell and verify that the formula cell returns the expected value (True/False for a validation).
  • When pasting back into SharePoint replace the cell names with the SharePoint column names. I.e. "EffectiveDate" with "[Effective Date]"

Details and examples here: http://techtrainingnotes.blogspot.com/2010/08/sharepoint-creating-calculated-column.html

Free Windows Admin Tool Kit Click here and download it now
September 12th, 2015 3:52pm

Hi LOSo7,

From your description, you want to allow users to select certain dates of the Effective Date column.

I agree with Mike, Per my test, it is working with the following validation:

=OR([Effective Date]=DATEVALUE("9/21/2015"),[Effective Date]=DATEVALUE("10/5/2015"), ...

Please remember to mark the replies as answers if they help.

Have a nice day.

Best Regards,

Lisa Chen

September 13th, 2015 9:42pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics