Link to home
Start Free TrialLog in
Avatar of oscarray
oscarray

asked on

how to store vb net dates before 1900

how to store vb net dates before 1900
Avatar of x-men
x-men
Flag of Portugal image

as string
Actually - If you configure the table to use 4 digit year instead of 2 digit years - you should have no problem

Just use General Date, Long Date or Short Date - (Medium Date is 2 digit year)
@oscarray

Datetime values are stored as double precision floating point values.  These are fully capable of handling negative values, which will accommodate 19th century dates.
ASKER CERTIFIED SOLUTION
Avatar of Shahan Ayyub
Shahan Ayyub
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
DateTime datatype in SQL will store that date range ok.

Supported date range =January 1, 1753, through December 31, 9999
http://msdn.microsoft.com/en-us/library/ms187819.aspx
where are you persisting the data?

If using SQL Server 2008+, you can use the Date column type to store date (only) values back to the year 1.
http://msdn.microsoft.com/en-us/library/bb630352.aspx

Of course, using the Date column type would mean that you would have to have a separate field for the time component or you could use the Datetime2 column type.
http://msdn.microsoft.com/en-us/library/bb677335.aspx