Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

date as number formula

Status
Not open for further replies.

spiceAlex

Technical User
May 22, 2008
13
US
Do any of you remember the formula to convert a date to its corresponding number wherein that number starts at 1/1/1900 (maybe it's 12/31/1899) with 1 and increases by 1 each day until whatever date you use as the maximum? For example 12/31/1901 would be 830? (or there abouts...I still need a cup of coffee this morning!)
I can't remember what it is but know I've used it in the past.
Thank you!!
 
The following would result in 730 (not 830):

datediff("d",date(1899,12,31),date(1901,12,31))

You need to know what the base date is though, and then use that as the second argument, and add the date you are converting as the third argument.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top