Solved

how to store vb net dates before 1900

Posted on 2011-09-04
7
372 Views
Last Modified: 2012-05-12
how to store vb net dates before 1900
0
Comment
Question by:oscarray
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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Advice in Xamarin 21 79
VB.Net - Project Software to help the Developer 7 34
VB.Net - TypeInitializer Error 25 28
location of a form 2 14
The System Center Operations Manager 2012, known as SCOM, is a part of the Microsoft system center product that provides the user with infrastructure monitoring and application performance monitoring. SCOM monitors:   Windows or UNIX/LinuxNetwo…
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…
Viewers will learn how to maximize accessibility options in an Excel workbook for users with accessibility issues.
Viewers will learn the different options available in the Backstage view in Excel 2013.

809 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