Output a date from an if function
-
14 มิถุนายน 2555 7:31
Hi
Working with lists in sharepoint 2010
I would like to create a calculated column in a list which will show today's date when another column(which is a yes/no radio button) is selected. For example Column1(available) is Yes/no if it is checked for yes then I would like Column2(Date Available) to automatically be set to the day of editing date.
Any ideas on how I can make this work?
ตอบทั้งหมด
-
14 มิถุนายน 2555 8:28
Hi,
You can use this formula:
=IF([Avaliable]="Yes", [Today], [Modified])
[Avaliable] = yes/no field
[Modified] = Modifiend date
[Today] = funcion used to get Date.Now. But in Calculated columns is not avaliable. You get an error when saving column. There are some trips here: http://abstractspaces.wordpress.com/2008/05/19/use-today-and-me-in-calculated-column/
REgards!
José Quinto Zamora
SharePoint and Search Specialist at SolidQ(http://www.solidq.com)
MCITP and MCPD in SharePoint 2010
http://blogs.solidq.com/sharepoint- เสนอเป็นคำตอบโดย José Quinto Zamora 14 มิถุนายน 2555 9:52
- ยกเลิกการนำเสนอเป็นคำตอบโดย Steven AndrewsEditor 14 มิถุนายน 2555 13:52
-
14 มิถุนายน 2555 8:29
You can't use de function Today() in an calculated column by default.
The work around for this is to make an column (single line text) with the name TODAY.Use your text-column Today in an calculated column (type Date and Time) and after making the formula delete the text-column Today.
For your requirement you can use a formula like:
=IF([another column]=TRUE;[Today];[Modified])
restriction for this work around is that each time you modify the calculated column you need the text-column Today.Hopes this helps.
- เสนอเป็นคำตอบโดย Bjoern H RappMicrosoft Community Contributor 14 มิถุนายน 2555 9:49
- ทำเครื่องหมายเป็นคำตอบโดย Steven AndrewsEditor 19 มิถุนายน 2555 14:03
-
14 มิถุนายน 2555 8:34
Debra,
- You need to create a column with the name "Today" in your list.
- Go to your calculated column and enter the following formula -
=IF([Column1] = TRUE, [Today], "") - Now delete the column "Today".
Regards, Huzefa Mala, MCTS
Please mark the post that answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem. -
14 มิถุนายน 2555 9:38Thank you very much to all answers. Making and deleting the today column worked perfectly.
-
14 มิถุนายน 2555 13:25
@Huzefa, @Jose and @Sjored
The fake today column trick doesn't give you anything more than using [Modified] so why faff around adding and deleting fake [Today] columns, it gets you nowhere! - [Today] == [Modified] !!!
http://blog.pathtosharepoint.com/2008/08/14/calculated-columns-the-useless-today-trick/
http://blog.pentalogic.net/2008/11/truth-about-using-today-in-calculated-columns/
=IF([Avaliable]="Yes", [Today], [Modified])
will work exactly the same as
=IF([Avaliable]="Yes", [Modified], [Modified])
Open a completed record tomorrow and click save. The dates updated even though it was already completed - @Debra is this really what you want?
Pentalogic Technology - Web Parts for Microsoft SharePoint www.pentalogic.net
-
17 มิถุนายน 2555 9:18