Set the Default Value in a DateTime Field When Using a Default Date Value

When adding a DateTime field to a list, you have the option of setting a Default value of Today.  However, this will make everything default to a 12AM Time.  By using the Calculated Value field, we can specify “Today+”08:00 AM” and now the field will default to Today’s date @ 8:00am. 

We can also add additional days to the default date, in case we’re creating things like tracking tickets with a follow up date,  by using this method we can do things like adding an additional day or additional week by using Today+7 to put it into next week, or Today+1 to calculate a follow up of tomorrow.

But lets say you want to only follow up on weekdays, now we get into some logic, and that’s where the WEEKDAY function comes in….

Day
Weekday Result
Sunday 1
Monday 2
Tuesday 3
Wednesday 4
Thursday 5
Friday 6
Saturday 7

 

So, If we enter something on a Friday, It should default to the following Monday:  In that case we’d need to add some logic into the Calculated Value field to take the weekdays into account, where if today is Friday, add 3 days, if today is Saturday, add 2 days, and if Today is Sunday or a regular weekday just add 1 day, which would look like this:

  =IF(WEEKDAY(Today) =  6, Today+3, IF(WEEKDAY(Today)=7, Today+2,Today+1))

That way, the Calculated Value of the follow up date will always fall on a weekday.

About The Author

Computer Geek, SharePoint MadHatter, devOps Champion, Automation Fan, PowerShell Player and sometimes I write Blog Stuff. I know GeekFu and TechNinja. Passionate about software delivery, devOps, agile and other things revolving around technology. This blog is mostly just for me to play around with and keep my hand in web technology and PHP

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Share This