Showing results for 
Search instead for 
Do you mean 

Creating calculated Date fields

Copper Elite Contributor
Posts: 90
Country: Canada

Creating calculated Date fields

[ Edited ]

Hi all,


Does anyone have some sample code that creates a calculated date field? Such as an Age field?


I am using some starter code from here:


I can create numeric fields with normal math functions without any issues, but I am not sure how to set up a field that relies on date.


I tried using the following for the ColumnCalDefinition, but I always get a negative value back, and in ACT, the field does not show as a regular calculated date field.


fd.ColumnCalDefinition = "datediff(day,getdate(),[BIRTHDATE])/(365.242199)";


Any help would be appreciated.



Ahsan Khalid

Chief Technology Officer
Keystroke Quality Computing Inc.

Copper Super Contributor
Posts: 485
Country: Australia

Re: Creating calculated Date fields

Act now has calculated fields built into the program why not use them to create a age field?

Jason Dawson Financial Planning
Brisbane | Australia - JDFP Home Page

Act Ver - Act! Premium Version, Hot Fix 3
OS - Windows 7 (stand alone machine)
MS Office - Enterprise 2007
Phone - Samsung Galaxy s6