Question : how to insert with vb.net a date time  column in sql server

Hi,

this query has a strange result:-

INSERT INTO xxx (aa,bb, Sent, Processed, cc,dd, linecount) VALUES ('aal','bb',26-6-2010,0,'A12977F0F1D340929172EB61DD80A653@aatjanPC3', 4,'0')

the column named Sent has a value of 26-6-2010

after the insert the corresponding column in sql server 2008 has a value of 1884-07-21 !!! what mistake do i make?

thanks!

Answer : how to insert with vb.net a date time  column in sql server

>>after the insert the corresponding column in sql server 2008 has a value of 1884-07-21 !!! what mistake do i make?<<
But to answer your question ....      :)

You have failed to add quotes around the date which is causing the following to happen:
1884-07-21 = -1990  ==> 1894-07-21 00:00:00.000

Your insert needs to look like this:
INSERT INTO xxx (aa,bb, Sent, Processed, cc,dd, linecount) VALUES ('aal','bb','20100626',0,'A12977F0F1D340929172EB61DD80A653@aatjanPC3', 4,'0')

Random Solutions  
 
programming4us programming4us