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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert date to number or general format?

Status
Not open for further replies.

amyceres

Technical User
Mar 28, 2013
23
I want to convert ({currentdate}+ 60)to a number format..
so it would be 4/22/13 +60 = 41446..I been searching through the forum and I haven't gotten a clear answer. So say use a datevalue() or a dateserial() but either of them work.
 
how do you arrive at 41446?
i at first thought epoch date, but that gives me a 1970 date for 41446.

 
4/22/13 + 60 would be 6/21/13 but I wanted it in general format or number format
 
i understand that i would be 6/21/2013, but how did you calculate the 41446 number?
is 4/22/2013 41386?
 
Yes I want to know how to convert the date to a general number...
 
41446 is days since 12/31/1899.

In VBA I'd convert a DateValue to a number via CInt() or CDbl() if you have a time value (decimal) component.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
thanks Skip.

so....to convert 4/22/2013 + 60 days...use datediff to calculate the number of days between your dates.

//{@DateToNumber}
datediff('d', #12/31/1899#,currentdate+60)


apologies for any syntax or other errors, i do not have crystal in front of me.
 
I am not using VBA but I am using Crystal Reports.
 
whoohoo they both work perfectly...thanks for the help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top