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!

Convertion number to Date format

Status
Not open for further replies.

vpk123

IS-IT--Management
Jan 13, 2006
17
US
I am using crystal reports 10 and oracle as database

i hv one field in number format, i want to convert to date format,

can any one help in this regard.

thanks
 
You need to show samples of the number and explain what the number represents.

-LB
 
If the field contains the number of seconds since January 1, 1970, use:
Code:
DateDiff("s", datetime(1970,01,01), {Your_Field})
- Ido

Visual CUT & DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Yes, lots of people can help, and 2 have tried already.

As LB stated, post what you have. Your post is suggesting that we guess at every possibility because you seemingly think that all dates in numerical format would be identical.

And you can probably make it even faster by not using Crystal syntax at all, use the t0_date function in a Crystal SQL Expression to perform it for you.

Again, this depends on the format, but that would prove the most efficient.

-k
 


Thanks for you support.

i hv field called arrival_time data is like 1144117649
actual value is 4/4/2006 10:27:29 AM

can some help how can i convert this numeric data to date format

i used the below formula, but i am getting error data "dates must be between year 1 and year 9999
DateDiff("s", datetime(1970,01,01), {Your_Field})
 
The formula should be:

dateadd("s",{table.yourfield},date(1970,1,1))

-LB
 
My mistake. Obviously, the formula I provided gives the number of seconds between your number field and the reference date. LB's formula is the correct approach to get the actual date represented by the number field.

- Ido

Visual CUT & DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top