If you try this in the browser you will get a message alon the line of Calculated columns cannot contain volatile functions like Today and Me'. At this point you go D'Oh!
But.... you can !!!
Before creating your calculated column you will need to create a column called Today or Me (depending on the calculation you want to create). Once this has been created, SharePoint lets you use the [Today] or [Me] functions in the calculation.
This example shows how to create an age calculated column.
[code:c#]
1. In your SharePoint list, create a column, title = DOB, type = Date, format = date only.
2. Create a column, title = Today, type = text.
3. Create a column, title = Age, type = calculated, calculation = DATEDIF([DOB],[Today],"Y")
4. Delete the column titled 'Today'
Now add a new item to the list. Set the DOB date (to somewhere in the past!) and save. The Age should have now been correctly calculated in Years.
[/code]
Note that once you have deleted the Today or Me column, if you try to edit the calculation in the future, SharePoint will complain again. However, you can simply create another column (Today or Me), edit your calculation, then Delete teh today / Me column again.