Go Premium for a chance to win a PS4. Enter to Win

x
Solved

# How to check in the existing formula in SharePoint calculated field and check the date field against current date

Posted on 2011-02-24
Medium Priority
776 Views
I have the following formula in SharePoint calculated field in a list. This one determines the Quarter based on the month in Deployment Start Date. Now I want to include in the formula
that if Deployment Start Date is past the Current Date or System Date then use a different date called Deployment End Date. How to include that in the below formula?

=IF([Deployment Start Date]=0,0,(CONCATENATE(RIGHT(YEAR([Deployment Start Date]),2),"Q",IF(MONTH([Deployment Start Date])<=3,1,IF(AND(MONTH([Deployment Start Date])>=4,MONTH([Deployment Start Date])<=6),2,IF(AND(MONTH([Deployment Start Date])>=7,MONTH([Deployment Start Date])<=9),3,IF(AND(MONTH([Deployment Start Date])>=10,MONTH([Deployment Start Date])<=12),4,0)))))))

0
Question by:vmandem

LVL 6

Accepted Solution

psv1973 earned 114 total points
ID: 34980231
The followign will give you the difference in days between the two dates,

DATEDIF(Now, [Deployment Start Date ],"d")

http://msdn.microsoft.com/en-us/library/bb862071.aspx

BTW: isn't 75 points a bit low for this?
0

LVL 9

Assisted Solution

irinuc earned 111 total points
ID: 34988558
Hi,

i'm unclear if in your situation "Current Date" and "System Date" are 2 columns in the list or you're simply thinking to compare to Today. If the second case, then this is not possible. Here is a link where you will find more details on why this is not working.
http://stackoverflow.com/questions/878744/any-solution-to-the-today-calculated-column-problem-is-sharepoint
Today can only be used in views; and maybe you can use this piece of information to workaround your problem. It really depends on what is the use of this formula.

hope this helps
0

Author Closing Comment

ID: 35014501
partial
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
###### Suggested Courses
Course of the Month6 days, 22 hours left to enroll