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

Converting Milliseconds to Date in Crystal 7

Status
Not open for further replies.

tokey63

MIS
Feb 16, 2006
2
US
I am having the most difficult time trying to create a report. Our database stores the date in milliseconds from 1/1/1970. When i try the dateadd function, it says out of range or too large. An example of the date is: 1078837200000
Can someone advise what i need to do to get this a date, i am then going to make it a parameter for the report as well (user can enter the start and end date). Do i need to create a formula field? I also tried the following:
EDate = ({TASKHOURS.entryDate}/86400000)

DateAdd("D", +Edate, Date(1970,1,1))

to create a variable and add the days to get a date, of course that didn't work.
Any help would be very much appreciated.

Thanks
 
Using your sample millisecond data of 107883720000:

numbervar newdate:=1078837200000; //substitute your field
numbervar tosecs:= newdate *(.001); //gets seconds
dateadd("s",tosecs, #Jan. 1, 1970#) //returns actual date
 
Thanks, I just figured that part out, I mean just figured it out as you replied. i'm sure i'm going to have the problems using that date as a search criteria.

I really do appreciate your help!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top