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

number - time conversion

Status
Not open for further replies.

121278

Programmer
Aug 6, 2001
35
0
0
AT
Hi,
does anyone know how to change information stored as number
into date format?
01.08.2001 gets 37.104,00 same problem as in excel when showing time as number...
right clicking the field and "format field" doesn't help, because there is no chance to say it's an time/date field

does anyone knows how
I can change that?

ca
 
Try this:

Date(1899,12,30)+{field}

or:

Date(1899,12,31)+{field}

One of these should work. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
DateValue({field}) will convert numeric values to dates, with Dec 30, 1899 being the "zero" date. Negative numeric values will produce dates dates prior to this, fractional values are ignored.
This function is new to V8 - the earlier equivalent is
Date(1899,12,30)+{field}
The advantage of DateValue is you don't have to remember whether it is Dec 30 or Dec 31 to use :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top