Solved

how to store vb net dates before 1900

Posted on 2011-09-04
7
382 Views
Last Modified: 2012-05-12
how to store vb net dates before 1900
0
Comment
Question by:oscarray
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 18

Expert Comment

by:x-men
ID: 36483553
as string
0
 
LVL 14

Expert Comment

by:Don Thomson
ID: 36484081
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)
0
 
LVL 45

Expert Comment

by:aikimark
ID: 36484689
@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.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 19

Accepted Solution

by:
Shahan Ayyub earned 500 total points
ID: 36484710
hi!

Why not simply like this?

 
       Dim dt As DateTime = New DateTime(1880, 3, 5)

Open in new window


0
 
LVL 12

Expert Comment

by:NormanMaina
ID: 36484769
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
0
 
LVL 45

Expert Comment

by:aikimark
ID: 36484842
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

0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The new Microsoft OS looks great, is easier than ever to upgrade to, it is even free.  So what's the catch?  If you don't change the privacy settings, Microsoft will, in accordance with the (EULA) you clicked okay to without reading, collect all the…
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
Viewers will learn the different options available in the Backstage view in Excel 2013.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question