The SharePoint Version Table has been updated with the Dec 2010 CU version numbers and download links. http://crayveon.com/sharepoint-solutions/sharepoint-versions-list/
Cheers
C
The SharePoint Knowledge Collection of Cornelius J. van Dyk, an 9 x SharePoint MVP
26 January 2011
25 January 2011
How do I – Get A Process ID in C#
Got this question recently… answer is by simply using the System.Diagnostics namespace…
System.Diagnostics.Process.GetProcessesByName("ProcessName")[0].Id;
Cheers
C
18 January 2011
Using the YEAR from a Date column in a calculated column in SharePoint
I got this question from someone on the forums and thought it might be worth reposting to my blog for later reference as well.
The question:
Now this one made me scratch my head for a minute and then I fired up my trusty “Calculated Column Debugger”… Excel!!!Hello – I have an out-of-the box date column titled, “Departure Date” which renders values in the format, ‘DD/MM/YYYY’. I want to be able to filter by Year only so I believe the easiest way to accomplish this is to create a calculated column titled, Year and populate that column with the YYYY values from the Departure Date column. I tried using several formulas but so far have been unsuccessful. I’m currently using this formula, “=TEXT(YEAR([Departure Date]),”YYYY”)” for the calculation value and the value comes up as “1905”…? Help!
USEFUL TIP: ALMOST ANY FORMULA YOU CAN PUT TOGETHER IN EXCEL, YOU CAN COPY TO A SHAREPOINT CALCULATED COLUMN AND IT SHOULD WORK JUST FINE.
I copied the formula over to an Excel cell and put a date in another cell to reference and sure enough… I got 1905 too! Then just looking at the formatting options for the TEXT method and the YEAR method, I was able to deduce the answer thus…
The answer:
The problem is that you’re doubling up on methods by passing the result from YEAR to the TEXT method. Either of the following should work just fine:
- =TEXT([Departure Date], “yyyy”)
- =YEAR([Departure Date])
Because the TEXT method is expecting a DATE value to be passed, but the YEAR method is returning a TEXT value, it confuses the TEXT method which doesn’t know how to interpret the value and thus produces the weird result you saw.
Cheers
C
Subscribe to:
Posts (Atom)
SharePoint Remote Event Receivers are DEAD!!!
Well, the time has finally come. It was evident when Microsoft started pushing everyone to WebHooks, but this FAQ and related announcement...
-
Ever wondered what the new SharePoint Online URLs are all about? Take for example https://cjvandyk.sharepoint.us/:x:/r/sites/Site1... What ...
-
Every so often, you run across the need to redirect a page somewhere else, like after a server migration when DNS isn’t used. By simply addi...
-
When using NuGet, we can easily run into assembly reference issues. A notorious error message is: CS0012: The type ‘System.Object’ is def...