If you counted all the days since January 1st, 0001 AD (counting that day as day 1), this function will return the day number for any given date. For example, the day number for 1st January, 2008, is 733,044.
This function is affected by the changeover date for the Gregorian calendar as specified in Preferences (i.e. either 1582 or 1752).
=DayNumber(%INDI.BIRT.DATE%)
=DayNumber(DateAt(2008,1,1))