?
Solved

how to store vb net dates before 1900

Posted on 2011-09-04
7
Medium Priority
?
385 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 46

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
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
LVL 19

Accepted Solution

by:
Shahan Ayyub earned 2000 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 46

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

771 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