Home > Archive > Microsoft SQL Server forum > June 2005 > How do I bring in a date which is in Integar form into a databse as a date form.









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How do I bring in a date which is in Integar form into a databse as a date form.
s commar

2005-06-28, 8:23 pm

Hi

I have a Platinum database which stores dates in integer form e.g the date
is formatted as below:

Column_name Type Length Precision
------------------------------ ------------------------------
from_date int 4 10


Some of the dates in the Platinum database are as follows:

729115
729359
730059
730241
730302
730455

How can I bring them into SQL 2000 as valid dates.

Thanks for your assistance

Sam C
s_commar@hotmail.com




Erland Sommarskog

2005-06-28, 8:24 pm

s commar (scommar@verizon.net) writes:
> I have a Platinum database which stores dates in integer form e.g the date
> is formatted as below:
>
> Column_name Type Length Precision
> ------------------------------ ------------------------------
> from_date int 4 10
>
>
> Some of the dates in the Platinum database are as follows:
>
> 729115
> 729359
> 730059
> 730241
> 730302
> 730455
>
> How can I bring them into SQL 2000 as valid dates.


1) Find out how these values are defined. It looks to me that they are
offsets from some base date.
2) Assuming that it is a base date, look up the dateadd function and
friends in Books Online.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com