Click here to Skip to main content
15,885,244 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
VB
Dim programDate_date21 As Date = reader.GetString(21)
                Dim bd21 As String = programDate_date21.Year.ToString.PadLeft(4, "0") + "-" + programDate_date21.Month.ToString.PadLeft(2, "0") + "-" + programDate_date21.Day.ToString.PadLeft(2, "0")


I am using vs 2008 express edition, and I want to retrieve 0000-00-00 date in date variable

the data is being retrieving from tb_kna_analysis_tv table .and i want to insert it into tb_kna_analysis_tv by using above code .
Posted
Comments
Kornfeld Eliyahu Peter 26-Feb-14 5:44am    
http://www.codeproject.com/Questions/733770/how-to-insert-0000-00-00-formatted-date-into-mysql
Santhoshpettacode 27-Feb-14 0:11am    
Your link was useful.

1 solution

You can't.

0000-00-00 is not a valid date: there is no "zeroth month" or "zeroth" day of the month.
 
Share this answer
 
Comments
Matt T Heffron 26-Feb-14 14:55pm    
...or "zeroth year" (thus 2000 was the last year of the 20th century, not the first of the 21st.) ;-)
+5
OriginalGriff 26-Feb-14 15:18pm    
Yeah, I agree - but...It *wounds* me that numbers run
...
2BC
1BC
1AD
2AD
...

My coder instincts scream at me: "It needs a elephanting zero index, goddamn it!" :laugh:
Matt T Heffron 26-Feb-14 15:37pm    
Should it be
0BC
or
0AD
or
0PH (PlaceHolder)
OriginalGriff 26-Feb-14 15:50pm    
I'm partial to 0BC because it looks more "Hex"ish, but then we could have 0AD simply to put an 'F' in front of it and snigger...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900