Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Integer date
Message
From
22/05/2003 14:31:13
 
 
To
22/05/2003 12:13:12
Philip Jones
Cornwall County Council
Truro, United Kingdom
General information
Forum:
Microsoft SQL Server
Category:
Import/Export
Title:
Miscellaneous
Thread ID:
00791686
Message ID:
00791815
Views:
30
Dates are stored as numbers in SQL Server. The base date (1/1/1900) is stored as 0, anything after that is a positive number, anything before that is a negative number:
declare @dt datetime
declare @today numeric(12,6)

set @dt = 0 --Day 0
select @dt

set @dt = 10.5 --Day 10, noon
select @dt

set @dt = -45105 --Independence Day 
select @dt

set @today = CAST(getdate() as numeric(12,6))
select @today
If you use the number from your example (54050400), you get an overflow so I am not sure if you can use it directly. Can you create a new record and check how the date gets saved? Then you might be able to figure out the formula.

Roman

>Hi,
>I'm looking at an sql server application which stores dates as iintrgers eg 54050400.
>I haven't got access to any of the code that manipulates the data. Can anyone tell me how the dates might have been converted to integers so that I can work out how to read them.
>
>
>Phil.
Roman Rehak, MCSD, MCDBA, MCSA
Competitive Computing
354 Mountain View Drive
Colchester, VT 05446-5824
802-764-1729
Previous
Reply
Map
View

Click here to load this message in the networking platform