Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: convert number to date Post Reply Post New Topic
Author Message
djstephens
Newbie
Newbie
Avatar

Joined: 27 Aug 2009
Location: Australia
Online Status: Offline
Posts: 16
Quote djstephens Replybullet Topic: convert number to date
     Posted: 13 Sep 2009 at 11:13pm
Hi
 
i am selecting data with a date field that outputs as 1,250,057,960,636.00 and would like to convert to date
 
i have notice that a report from the system where the data resides extracts with sql longtodate command
 
eg SELECT longtodate(wo.CREATEDTIME) "Created Time
Dazza
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 14 Sep 2009 at 6:23am
Sorry, can't help.  That command is not part of the SQL Server 2005.  I would guess that the number is the number of seconds, but it could be milliseconds, from some date.  Doing some quick calculations, it would be milliseconds, and starting from some date in 1968...
 
So I really don't have a clue.
 
Sorry I can't be of more help.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 15 Sep 2009 at 7:27am

I would agree with Lockwelles assessment that this is an interval number from a static start datetime. if you can determine what both of those items are you can use the DateAdd() to get the date field type you desire:

Dateadd("interval type",table.yourfield,#startdatetime#)
 
Try an internet search on your data source type to see if someone else has already identified these two items for you.


Edited by DBlank - 15 Sep 2009 at 7:28am
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum