Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 How to convert a 5 digit date to a normal date?

Author  Topic 

lw1990
Yak Posting Veteran

85 Posts

Posted - 2009-04-27 : 15:16:49
Hi,
I have a table with a field which datatype is "int", but actually is a date value, like '74779'. And another field which data type is "int" too, and it is a time value like '3229406'.

Are they Julian Date/Time?
How can I convert them to normal date(DD/MM/YYYY) and time(HH:MM:SS)?

Thanks.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-04-27 : 15:33:18
Can you provide us with some information of which date 74779 should represent?
And which time that 3229406 represents would be great!



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

lw1990
Yak Posting Veteran

85 Posts

Posted - 2009-04-27 : 15:53:59
Thank you Peso,
The 2 fields are in the table of Working Records, one field called "WorkDate", datatype is "int", values in the table are like '74925', '75003'... Another field is called "StarTime", datatype is "int", values in the table are like '3325572', '3262133'...

I'm trying to make a view to get the useful value from the table and then to make a report. But first thing is to make the date and time value readable.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-04-27 : 15:58:12
I figured that out, but what date is really 74779?
Can you see that in the application?

Because 74779 ca be number of weeks since some day in period, or number of days since the year 1804.



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

lw1990
Yak Posting Veteran

85 Posts

Posted - 2009-04-27 : 16:12:35
I copy the record with the date '74779' from SQL Server2000 table and paste to a Excel and changed the format cells to Date. the date I got is '9/25/2004'. Is this 5 digit number called "Julian Date"? What about the 7 digit Time?

Thanks.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-04-27 : 16:16:40
What time is '3325572' meant to represent?



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-04-27 : 16:17:15
It seems your "base date" is January 1st, 1800.



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page
   

- Advertisement -